mirror of
https://github.com/php/php-src.git
synced 2024-09-24 19:37:26 +00:00
9a44a9806c
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.
18 lines
326 B
PHP
18 lines
326 B
PHP
--TEST--
|
|
Invalid conflict resolution (unused trait as lhs of "insteadof")
|
|
--FILE--
|
|
<?php
|
|
trait T1 {
|
|
function foo() {echo "T1\n";}
|
|
}
|
|
trait T2 {
|
|
function foo() {echo "T2\n";}
|
|
}
|
|
class C {
|
|
use T1 {
|
|
T2::foo insteadof T1;
|
|
}
|
|
}
|
|
--EXPECTF--
|
|
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
|