diff --git a/tests/compiler/type_decl/namespaced-composite-property-arginfo.phpt b/tests/compiler/type_decl/namespaced-composite-property-arginfo.phpt new file mode 100644 index 00000000..7d034fff --- /dev/null +++ b/tests/compiler/type_decl/namespaced-composite-property-arginfo.phpt @@ -0,0 +1,62 @@ +--TEST-- +Namespaced union and intersection properties generate valid arginfo identifiers +--FILE-- +union = $union; + $this->intersection = $intersection; + } + } + + function run(): void + { + $both = new Both(); + $holder = new Holder(new Alternative(), $both); + + echo (new \ReflectionProperty(Holder::class, 'union'))->getType(), "\n"; + echo (new \ReflectionProperty(Holder::class, 'intersection'))->getType(), "\n"; + var_dump($holder->union instanceof Alternative); + var_dump($holder->intersection instanceof Both); + + $holder->union = $both; + var_dump($holder->union instanceof Both); + } +} + +namespace { + function main(): void + { + \NamespacedArginfo\run(); + } +} +?> +--EXPECT-- +NamespacedArginfo\Left|NamespacedArginfo\Alternative +NamespacedArginfo\Left&NamespacedArginfo\Right +bool(true) +bool(true) +bool(true)