conflict003.phpt 529 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Two methods resulting in a conflict, should be reported both.
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. trait A {
  7. public function smallTalk() {
  8. echo 'a';
  9. }
  10. public function bigTalk() {
  11. echo 'A';
  12. }
  13. }
  14. trait B {
  15. public function smallTalk() {
  16. echo 'b';
  17. }
  18. public function bigTalk() {
  19. echo 'B';
  20. }
  21. }
  22. class Talker {
  23. use A, B;
  24. }
  25. ?>
  26. --EXPECTF--
  27. Fatal error: Trait method B::smallTalk has not been applied as Talker::smallTalk, because of collision with A::smallTalk in %s on line %d