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