bug77291.phpt 687 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. ===DONE===
  32. --EXPECT--
  33. bool(true)
  34. string(10) "Some value"
  35. ===DONE===