Language: copy parent instance property defaults onto subclass slots (#31895) - #31899
Merged
Merged
Conversation
…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>
This was referenced Aug 17, 2026
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
inheritParentInstancePropertiescopied typed-init guards (Language: inherited typed property Error cites subclass — Zend declaring class (zend_object_handlers.c) #31785) but notpropertyDefaults/runtimePropertyNewDefaults, so JIT/AOTnew Childleft inherited slots UNDEF.zend_inheritance.c).php-src:
Zend/zend_inheritance.c(merge parent default_properties) /Zend/zend_objects.c(apply atnew).PHP:
lib/JIT/Builtin/Type/Object_.phpcopyInheritedInstancePropertySlotMeta().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 (sameObject_::allocateas AOT)./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_31895_inherited_prop_defaults.php'— fivehi./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/issue_31895_inherited_prop_defaults.php'— fivehi./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)memcpy.N/memset.Nlink (undefined reference to memcpy.7). Same lowering as JIT; AOT fixture is intest/fixtures/aot/cases/inherited_property_defaults_31895.phptfor when Fix: AOT link fails for EVERY binary — duplicate memset declaration #31894 / memcpy-decl lands.Made with Cursor