Skip to content

Language: copy parent instance property defaults onto subclass slots (#31895) - #31899

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-31895-aot-inherited-prop-defaults
Aug 17, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-31895-aot-inherited-prop-defaults

Conversation

@PurHur

@PurHur PurHur commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

php-src: Zend/zend_inheritance.c (merge parent default_properties) / Zend/zend_objects.c (apply at new).
PHP: lib/JIT/Builtin/Type/Object_.php copyInheritedInstancePropertySlotMeta().

Test plan

  • ./script/phpunit.sh --filter InheritedPropertyDefaults31895Test — VM unit, hi × 5
  • ./script/phpunit.sh --filter InheritedPropertyDefaults31895VMTest — compliance VM
  • ./script/phpunit.sh --filter InheritedPropertyDefaults31895JITTest — compliance JIT (same Object_::allocate as AOT)
  • ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_31895_inherited_prop_defaults.php' — five hi
  • ./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/issue_31895_inherited_prop_defaults.php' — five hi
  • ./script/phpunit.sh --filter InheritedTypedPropertyErrorClass — uninit inherited typed still errors (Language: inherited typed property Error cites subclass — Zend declaring class (zend_object_handlers.c) #31785)
  • Native AOT binary: blocked on master by duplicate memcpy.N/memset.N link (undefined reference to memcpy.7). Same lowering as JIT; AOT fixture is in test/fixtures/aot/cases/inherited_property_defaults_31895.phpt for when Fix: AOT link fails for EVERY binary — duplicate memset declaration #31894 / memcpy-decl lands.

Made with Cursor

…31895)

inheritParentInstanceProperties copied typed-init guards but not
propertyDefaults, so AOT/JIT `new Child` left inherited slots UNDEF
(typed Error / untyped warning). Match zend_inheritance.c by copying
compile-time and `new` defaults onto the child slot map.

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.

AOT: inherited property defaults are not initialised — every subclass loses its parent's defaults

1 participant