diff options
Diffstat (limited to 'ext/reflection/tests/ReflectionEnum_getBackingType.phpt')
-rw-r--r-- | ext/reflection/tests/ReflectionEnum_getBackingType.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/reflection/tests/ReflectionEnum_getBackingType.phpt b/ext/reflection/tests/ReflectionEnum_getBackingType.phpt new file mode 100644 index 0000000000..e9d429f592 --- /dev/null +++ b/ext/reflection/tests/ReflectionEnum_getBackingType.phpt @@ -0,0 +1,20 @@ +--TEST-- +ReflectionEnum::getBackingType() +--FILE-- +<?php + +enum Enum_ {} +enum IntEnum: int {} +enum StringEnum: string {} + +function test(): string {} + +var_dump((new ReflectionEnum(Enum_::class))->getBackingType()); +echo (new ReflectionEnum(IntEnum::class))->getBackingType() . "\n"; +echo (new ReflectionEnum(StringEnum::class))->getBackingType() . "\n"; + +?> +--EXPECT-- +NULL +int +string |