Language: fix ReflectionProperty::isLazy for lazy modifier (#16953)#16956
Closed
PurHur wants to merge 1 commit into
Closed
Language: fix ReflectionProperty::isLazy for lazy modifier (#16953)#16956PurHur wants to merge 1 commit into
PurHur wants to merge 1 commit into
Conversation
Place phpc-lazy-property marker before visibility so nikic preserves Stmt\Property comments for ZEND_ACC_LAZY recovery; fix VM\TypeCheck import in lazy init path. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
|
Superseded by #16955 (merged to master) — same root cause and fix. Closing duplicate. |
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
/*phpc-lazy-property*/marker before the visibility keyword so nikic/php-parser attaches it toStmt\Propertycomments (same pattern as asymmetric-visibility markers).ZEND_ACC_LAZYat compile time viaLazyPropertyRewriter::isLazyFromAttributes()soClassProperty::$lazyis set andReflectionProperty::isLazy()matches Zend before/after first read.LazyPropertySupportto useVM\TypeCheck(lazy init path was never exercised while the flag stayed false).Root cause
LazyPropertyRewriterinserted the marker afterpublic, so nikic did not preserve it on the property stmt;propertyLazystayed false, defaults were copied at construction, andisLazy()always returned false.php-src reference
ext/reflection/php_reflection.c—ReflectionProperty::isLazy()Zend/zend_compile.c—ZEND_ACC_LAZYVerification
Closes #16953
Made with Cursor