error_010.phpt 469 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Trying to exclude trait method multiple times
  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. class bar {
  12. use foo, c { c::test insteadof foo; }
  13. use foo, c { c::test insteadof foo; }
  14. }
  15. $x = new bar;
  16. var_dump($x->test());
  17. ?>
  18. --EXPECTF--
  19. Fatal error: Failed to evaluate a trait precedence (test). Method of trait foo was defined to be excluded multiple times in %s on line %d