bug77291.phpt 665 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Bug #77291 (magic methods inherited from a trait may be ignored)
  3. --FILE--
  4. <?php
  5. trait AccessibleProperties
  6. {
  7. public function __isset($property)
  8. {
  9. return property_exists($this, $property);
  10. }
  11. public function __get($property)
  12. {
  13. if (property_exists($this, $property)) {
  14. return $this->$property;
  15. }
  16. }
  17. }
  18. class Foo4567 {
  19. use AccessibleProperties;
  20. protected $a = 'Some value';
  21. }
  22. class Foo45 {
  23. use AccessibleProperties;
  24. protected $a = 'Some value';
  25. }
  26. $foo = new Foo4567;
  27. var_dump(isset($foo->a));
  28. $foo = new Foo45;
  29. var_dump($foo->a);
  30. ?>
  31. --EXPECT--
  32. bool(true)
  33. string(10) "Some value"