diff options
Diffstat (limited to 'Zend/tests/enum/value-property-type.phpt')
-rw-r--r-- | Zend/tests/enum/value-property-type.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/tests/enum/value-property-type.phpt b/Zend/tests/enum/value-property-type.phpt new file mode 100644 index 0000000000..ed009dd981 --- /dev/null +++ b/Zend/tests/enum/value-property-type.phpt @@ -0,0 +1,20 @@ +--TEST-- +Enum value property has automatic type +--FILE-- +<?php + +enum IntEnum: int { + case Foo = 0; +} + +enum StringEnum: string { + case Foo = 'Foo'; +} + +echo (new ReflectionProperty(IntEnum::class, 'value'))->getType() . "\n"; +echo (new ReflectionProperty(StringEnum::class, 'value'))->getType() . "\n"; + +?> +--EXPECT-- +int +string |