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