You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recursion protection for deprecation constants not released on bailout #18463
<?phpfunctionhandler($errno, $errstr, $errfile, $errline) {
echo"$errstr in $errfile on line $errline\n";
eval('class string {}');
}
set_error_handler( 'handler' );
var_dump( _ZendTestClass::ZEND_TEST_DEPRECATED );
Invoked with php --repeat 2 /var/www/html/test.php
Resulted in this output:
Executing for the first time...
Constant _ZendTestClass::ZEND_TEST_DEPRECATED is deprecated in /var/www/html/test.php on line 10
Fatal error: Cannot use "string" as a class name as it is reserved in /var/www/html/test.php(5) : eval()'d code on line 1
Finished execution, repeating...
int(42)
But I expected this output instead:
Executing for the first time...
Constant _ZendTestClass::ZEND_TEST_DEPRECATED is deprecated in /var/www/html/test.php on line 10
Fatal error: Cannot use "string" as a class name as it is reserved in /var/www/html/test.php(5) : eval()'d code on line 1
Finished execution, repeating...
Constant _ZendTestClass::ZEND_TEST_DEPRECATED is deprecated in /var/www/html/test.php on line 10
Fatal error: Cannot use "string" as a class name as it is reserved in /var/www/html/test.php(5) : eval()'d code on line 1
Caused by the recursion protection (CONST_RECURSIVE flag) not getting removed because the user handler triggers a bailout. Should only apply to internal constants because userland constants aren't in the persistent memory and so would get recreated on a new request anyway
Also affects non-class constants on master following #16952
Relates to #17712
changed the title [-]Recursion protection for deprecation constants not released on bailout[/-][+]Reapply GH-17712 with a fix for internal class constants[/+]on Apr 30, 2025
changed the title [-]Reapply GH-17712 with a fix for internal class constants[/-][+]Recursion protection for deprecation constants not released on bailout[/+]on Apr 30, 2025
Activity
Revert "Fix infinite recursion on deprecated attribute evaluation"
[-]Recursion protection for deprecation constants not released on bailout[/-][+]Reapply GH-17712 with a fix for internal class constants[/+][-]Reapply GH-17712 with a fix for internal class constants[/-][+]Recursion protection for deprecation constants not released on bailout[/+]Revert "Fix infinite recursion on deprecated attribute evaluation"
Reapply phpGH-17712 with a fix for internal class constants
Reapply GH-17712 with a fix for internal class constants (#18464)