Annotation of embedaddon/php/Zend/tests/traits/error_015.phpt, revision 1.1
1.1 ! misho 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:
! 7: trait foo {
! 8: public function test() { return 3; }
! 9: }
! 10:
! 11: trait baz {
! 12: public function test() { return 4; }
! 13: }
! 14:
! 15: class bar {
! 16: use foo, baz {
! 17: baz::test as zzz;
! 18: }
! 19: }
! 20:
! 21: $x = new bar;
! 22: var_dump($x->test());
! 23:
! 24: ?>
! 25: --EXPECTF--
! 26: Fatal error: Trait method test has not been applied, because there are collisions with other trait methods on bar in %s on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>