diff --git a/tests/aot/basic/trait-private-property-write-inherited.phpt b/tests/aot/basic/trait-private-property-write-inherited.phpt new file mode 100644 index 00000000..5bdbc946 --- /dev/null +++ b/tests/aot/basic/trait-private-property-write-inherited.phpt @@ -0,0 +1,44 @@ +--TEST-- +trait method writes injected private property on child object +--SKIPIF-- +--FILE-- +items !== null) { + return $this->items; + } + return $this->items = [1, 3, 4]; + } +} + +class PropertyOwner +{ + use PrivatePropertyWriter; +} + +class ChildPropertyOwner extends PropertyOwner +{ +} + +function main(): void +{ + $object = new ChildPropertyOwner(); + var_dump($object->items()); +} + +?> +--EXPECT-- +array(3) { + [0]=> + int(1) + [1]=> + int(3) + [2]=> + int(4) +}