error_015.phpt 491 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Trying to add an alias to a trait method where there is another with same name.
  3. Should warn about the conflict.
  4. --FILE--
  5. <?php
  6. trait foo {
  7. public function test() { return 3; }
  8. }
  9. trait baz {
  10. public function test() { return 4; }
  11. }
  12. class bar {
  13. use foo, baz {
  14. baz::test as zzz;
  15. }
  16. }
  17. $x = new bar;
  18. var_dump($x->test());
  19. ?>
  20. --EXPECTF--
  21. Fatal error: Trait method baz::test has not been applied as bar::test, because of collision with foo::test in %s on line %d