bug64070.phpt 535 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Bug #64070 (Inheritance with Traits failed with error)
  3. --FILE--
  4. <?php
  5. trait first_trait
  6. {
  7. function first_function()
  8. {
  9. echo "From First Trait\n";
  10. }
  11. }
  12. trait second_trait
  13. {
  14. use first_trait {
  15. first_trait::first_function as second_function;
  16. }
  17. function first_function()
  18. {
  19. echo "From Second Trait\n";
  20. }
  21. }
  22. class first_class
  23. {
  24. use second_trait;
  25. }
  26. $obj = new first_class();
  27. $obj->first_function();
  28. $obj->second_function();
  29. ?>
  30. --EXPECT--
  31. From Second Trait
  32. From First Trait