-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Recursion protection for deprecation constants not released on bailout #18463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
DanielEScherzer
added a commit
to DanielEScherzer/php-src
that referenced
this issue
Apr 29, 2025
Internal constants are persisted; if a user error handler triggers bailout before the recursion flag is removed then a subsequent request (e.g. with `--repeat 2`) will start with that flag already applied. Internal constants can presumably be trusted not to use deprecation messages that come from recursive attributes.
DanielEScherzer
added a commit
to DanielEScherzer/php-src
that referenced
this issue
Apr 29, 2025
Internal constants are persisted; if a user error handler triggers bailout before the recursion flag is removed then a subsequent request (e.g. with `--repeat 2`) will start with that flag already applied. Internal constants can presumably be trusted not to use deprecation messages that come from recursive attributes.
iluuu1994
added a commit
that referenced
this issue
Apr 30, 2025
DanielEScherzer
added a commit
to DanielEScherzer/php-src
that referenced
this issue
Apr 30, 2025
Add recursion protection when emitting deprecation warnings for class constants, since the deprecation message can come from an attribute that is using the same constant for the message, or otherwise result in recursion. But, internal constants are persisted, and thus cannot have recursion protection. Otherwise, if a user error handler triggers bailout before the recursion flag is removed then a subsequent request (e.g. with `--repeat 2`) would start with that flag already applied. Internal constants can presumably be trusted not to use deprecation messages that come from recursive attributes. Fixes phpGH-18463 Fixes phpGH-17711
SakiTakamachi
pushed a commit
that referenced
this issue
May 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The following code:
Invoked with
php --repeat 2 /var/www/html/test.php
Resulted in this output:
But I expected this output instead:
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 anywayAlso affects non-class constants on master following #16952
Relates to #17712
PHP Version
PHP 8.4 @ e18498e
PHP master @ 26dbcb7
Operating System
No response
The text was updated successfully, but these errors were encountered: