gh8444.phpt 645 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. GH-8444 (Fix ReflectionProperty::__toString() of properties containing instantiated enums)
  3. --FILE--
  4. <?php
  5. enum Foo
  6. {
  7. case Bar;
  8. }
  9. class Bar
  10. {
  11. public Foo $enum = Foo::Bar;
  12. public $enumInArray = [Foo::Bar];
  13. }
  14. echo new \ReflectionProperty('Bar', 'enum'), "\n";
  15. echo new \ReflectionProperty('Bar', 'enumInArray'), "\n";
  16. echo new \ReflectionProperty(new Bar, 'enum'), "\n";
  17. echo new \ReflectionProperty(new Bar, 'enumInArray'), "\n";
  18. ?>
  19. --EXPECT--
  20. Property [ public Foo $enum = Foo::Bar ]
  21. Property [ public $enumInArray = [Foo::Bar] ]
  22. Property [ public Foo $enum = Foo::Bar ]
  23. Property [ public $enumInArray = [Foo::Bar] ]