php-src/Zend/tests/traits/methods_002.phpt
Stefan Marr 1d2a63da5f Changed collision warning for Traits to fatal error.
#This change is made to have all possible cases of collisions consistently handled as fatal errors.
#The reason to have it fatal is that most likely something changed unexpectedly and needs urgent attention by the developer, since it will fail eventually anyway for instance because the expected method is missing in the class.
#Discussed in this thread: http://marc.info/?l=php-internals&m=129155790226876
2010-12-12 16:48:02 +00:00

29 lines
428 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--
Fatal error: Trait method __clone has not been applied, because there are collisions with other trait methods on bar in %s on line %d