Repository navigation
Language: AOT ReflectionProperty::isFinal for final plain props (#27315) - #27336
Merged
Merged
Conversation
Thin AOT skipped ReflectionProperty::__construct and stored name/class in TYPE_STRING slots that dropped __value__ boxes, so isFinal always saw empty strings. Match #27303: TYPE_VALUE + markHasConstructor, and compare via structGep / constantStringFromString. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReflectionProperty::isFinal() === falseforfinal publicproperties underPHP_COMPILER_PROFILE=8.4while VM/JIT returnedtrue.new ReflectionProperty(no__construct) plusTYPE_STRINGslots that drop the__value__*boxes written byemitSetStringPropertyFromCstr, so the isFinal strcmp table always saw empty class/prop names.TYPE_VALUE+markHasConstructorfor ReflectionProperty; harden isFinal strcmp viastructGep/constantStringFromString.php-src-strict note: Zend 8.4
finalon plain properties is inheritance-only (writes after construct succeed). The issue body's "write throws Error" expectation was incorrect; expected output iswrote+isFinal=1.Closes #27315
Test plan
PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_final_plain_property_84.php→wrote/isFinal=1PHP_COMPILER_PROFILE=8.4 php bin/jit.php test/repro/maintainer_gap_final_plain_property_84.php→ samePHP_COMPILER_PROFILE=8.4 ./phpc build -o /tmp/f84 … && /tmp/f84→ samevendor/bin/phpunit --filter FinalPropertyOverrideCheckTest→ OK (20)vendor/bin/phpunit --filter final_plain_property_isfinal_84→ OK (AOT fixture)Pillar preflight (master, before claim)
bootstrap-inventory --check: ok (6890/6890)release-readiness --json:user_release_ready=no—north-star5-fastfail (gen-0 manifest/driver mismatch Self-host M5: bootstrap-inventory argv driver size floor — grow beyond 451KB stub #8713, pre-existing; not touched here)Made with Cursor