bug55355.phpt 741 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. Bug #55355 (Abstract functions required by a trait are not correctly found when implemented in an ancestor class)
  3. --FILE--
  4. <?php
  5. // A trait that has a abstract function
  6. trait ATrait {
  7. function bar() {
  8. $this->foo();
  9. }
  10. abstract function foo();
  11. }
  12. // A class on the second level in the
  13. // inheritance chain
  14. class Level2Impl {
  15. function foo() {}
  16. }
  17. class Level1Indirect extends Level2Impl {}
  18. // A class on the first level in the
  19. // inheritance chain
  20. class Level1Direct {
  21. function foo() {}
  22. }
  23. // Trait Uses
  24. class Direct {
  25. use ATrait;
  26. function foo() {}
  27. }
  28. class BaseL2 extends Level1Indirect {
  29. use ATrait;
  30. }
  31. class BaseL1 extends Level1Direct {
  32. use ATrait;
  33. }
  34. echo 'DONE';
  35. ?>
  36. --EXPECT--
  37. DONE