php-src/Zend/tests/traits/language016.phpt
Xinchen Hui 9a44a9806c Fixed bug #64235 (Insteadof not work for class method in 5.4.11)
As we discussed with stefan, we think previous of allowing use with
classes is a bug, should be forbided, anyway, the error message should
be improved.
2013-02-21 18:18:41 +08:00

18 lines
326 B
PHP

--TEST--
Invalid conflict resolution (unused trait as rhs of "insteadof")
--FILE--
<?php
trait T1 {
function foo() {echo "T1\n";}
}
trait T2 {
function foo() {echo "T2\n";}
}
class C {
use T1 {
T1::foo insteadof T2;
}
}
--EXPECTF--
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d