overridding-conflicting-methods.phpt 437 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Overriding Conflicting Methods should not result in a notice/warning about collisions
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. trait THello1 {
  7. public function hello() {
  8. echo 'Hello';
  9. }
  10. }
  11. trait THello2 {
  12. public function hello() {
  13. echo 'Hello';
  14. }
  15. }
  16. class TraitsTest {
  17. use THello1;
  18. use THello2;
  19. public function hello() {
  20. echo 'Hello';
  21. }
  22. }
  23. $test = new TraitsTest();
  24. $test->hello();
  25. ?>
  26. --EXPECT--
  27. Hello