mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
1944c14ce7
Fix GH-8444
32 lines
645 B
PHP
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] ]
|