diff options
Diffstat (limited to 'Zend/tests/type_declarations/typed_properties_059.phpt')
-rw-r--r-- | Zend/tests/type_declarations/typed_properties_059.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Zend/tests/type_declarations/typed_properties_059.phpt b/Zend/tests/type_declarations/typed_properties_059.phpt new file mode 100644 index 0000000000..caee8501f7 --- /dev/null +++ b/Zend/tests/type_declarations/typed_properties_059.phpt @@ -0,0 +1,29 @@ +--TEST-- +Nullable typed properties in traits +--FILE-- +<?php +trait T { + public int $a1; + public ?int $b1; +} + +class A { + use T; + public int $a2; + public ?int $b2; +} + +$x = new A; +var_dump($x); +?> +--EXPECT-- +object(A)#1 (0) { + ["a2"]=> + uninitialized(int) + ["b2"]=> + uninitialized(?int) + ["a1"]=> + uninitialized(int) + ["b1"]=> + uninitialized(?int) +} |