Skip to content

Language: wire lazy property PHPCfg marker → ReflectionProperty::isLazy (#16813)#16955

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-16813-lazy-property-islazy
Jul 6, 2026
Merged

Language: wire lazy property PHPCfg marker → ReflectionProperty::isLazy (#16813)#16955
PurHur merged 1 commit into
masterfrom
agent/issue-16813-lazy-property-islazy

Conversation

@PurHur

@PurHur PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Place /*phpc-lazy-property*/ marker before visibility (leading comment recovery like asymmetric visibility) so php-parser/PHPCfg preserve it
  • Add propertyLazy on PHPCfg Property + extractLazyPropertyFromAttributes() in Parser (patch overlay)
  • Compiler reads $child->propertyLazy; fix VM\TypeCheck import in LazyPropertySupport
  • Refresh docs/bootstrap-inventory.md for lazy-property files on vm.php path

Root cause

LazyPropertyRewriter embedded the marker between public and the type; php-parser only attaches leading comments to Stmt\Property, so propertyLazy never reached DECLARE_PROPERTY and ReflectionProperty::isLazy() was always false.

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_lazy_property_modifier_parse.php'
# lazy / hello / initialized / ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_PROFILE=8.4 vendor/bin/phpunit --filter LazyPropertyRewriterTest'

php script/bootstrap-inventory.php --check
# OK 4182/4182

make bootstrap-selfhost-vm-driver-execute-probe
# OK

Closes #16813

Made with Cursor

Place phpc-lazy-property comment before visibility (php-parser leading
comment recovery), add PHPCfg propertyLazy + Parser extraction, and fix
VM\TypeCheck import in LazyPropertySupport. Refresh bootstrap inventory.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language: lazy property modifier (public lazy Type $prop) — parse rejected on forward profile (PHP 8.4, Zend/zend_compile.c)

1 participant