@@ -564,12 +564,12 @@ PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf) /* {{{ */
564564 * if the result won't be used. (https://github.com/php/php-src/issues/8044) */
565565 zend_object * zobj = Z_OBJ_P (struc );
566566 uint32_t * guard = zend_get_recursion_guard (zobj );
567- if (ZEND_GUARD_OR_GC_IS_RECURSIVE (guard , DEBUG , zobj )) {
567+ if (ZEND_GUARD_OR_GC_IS_RECURSIVE (guard , EXPORT , zobj )) {
568568 smart_str_appendl (buf , "NULL" , 4 );
569569 zend_error (E_WARNING , "var_export does not handle circular references" );
570570 return ;
571571 }
572- ZEND_GUARD_OR_GC_PROTECT_RECURSION (guard , DEBUG , zobj );
572+ ZEND_GUARD_OR_GC_PROTECT_RECURSION (guard , EXPORT , zobj );
573573 myht = zend_get_properties_for (struc , ZEND_PROP_PURPOSE_VAR_EXPORT );
574574 if (level > 1 ) {
575575 smart_str_appendc (buf , '\n' );
@@ -603,7 +603,7 @@ PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf) /* {{{ */
603603 }
604604 zend_release_properties (myht );
605605 }
606- ZEND_GUARD_OR_GC_UNPROTECT_RECURSION (guard , DEBUG , zobj );
606+ ZEND_GUARD_OR_GC_UNPROTECT_RECURSION (guard , EXPORT , zobj );
607607 if (level > 1 && !is_enum ) {
608608 buffer_append_spaces (buf , level - 1 );
609609 }
0 commit comments