error_011.phpt 421 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Testing trait collisions
  3. --FILE--
  4. <?php
  5. trait foo {
  6. public function test() { return 3; }
  7. }
  8. trait c {
  9. public function test() { return 2; }
  10. }
  11. trait b {
  12. public function test() { return 1; }
  13. }
  14. class bar {
  15. use foo, c, b;
  16. }
  17. $x = new bar;
  18. var_dump($x->test());
  19. ?>
  20. --EXPECTF--
  21. Fatal error: Trait method c::test has not been applied as bar::test, because of collision with foo::test in %s on line %d