summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/methods_002.phpt
blob: 2c72f6c5a68d6f5d451ba3ab62dc8352bda3f951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Testing collision with magic methods
--FILE--
<?php

trait foo {
    public function __clone() {
        var_dump(__FUNCTION__);
    }
}

trait baz {
    public function __clone() {
        var_dump(__FUNCTION__);
    }
}

class bar {
    use foo;
    use baz;
}

$o = new bar;
var_dump(clone $o);

?>
--EXPECTF--
Fatal error: Trait method baz::__clone has not been applied as bar::__clone, because of collision with foo::__clone in %s on line %d