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