mirror of
https://github.com/php/php-src.git
synced 2024-10-17 06:22:53 +00:00
31 lines
447 B
PHP
31 lines
447 B
PHP
--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--
|
|
Warning: Trait method __clone has not been applied, because there are collisions with other trait methods on bar in %s on line %d
|
|
object(bar)#%d (0) {
|
|
}
|