1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Files
archived-php-src/ext/reflection/tests/gh8444.phpt
T
2022-04-28 19:48:23 +02:00

32 lines
645 B
PHP

--TEST--
GH-8444 (Fix ReflectionProperty::__toString() of properties containing instantiated enums)
--FILE--
<?php
enum Foo
{
case Bar;
}
class Bar
{
public Foo $enum = Foo::Bar;
public $enumInArray = [Foo::Bar];
}
echo new \ReflectionProperty('Bar', 'enum'), "\n";
echo new \ReflectionProperty('Bar', 'enumInArray'), "\n";
echo new \ReflectionProperty(new Bar, 'enum'), "\n";
echo new \ReflectionProperty(new Bar, 'enumInArray'), "\n";
?>
--EXPECT--
Property [ public Foo $enum = Foo::Bar ]
Property [ public $enumInArray = [Foo::Bar] ]
Property [ public Foo $enum = Foo::Bar ]
Property [ public $enumInArray = [Foo::Bar] ]