mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
1d2a63da5f
#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
27 lines
480 B
PHP
27 lines
480 B
PHP
--TEST--
|
|
Trying to add an alias to a trait method where there is another with same name.
|
|
Should warn about the conflict.
|
|
--FILE--
|
|
<?php
|
|
|
|
trait foo {
|
|
public function test() { return 3; }
|
|
}
|
|
|
|
trait baz {
|
|
public function test() { return 4; }
|
|
}
|
|
|
|
class bar {
|
|
use foo, baz {
|
|
baz::test as zzz;
|
|
}
|
|
}
|
|
|
|
$x = new bar;
|
|
var_dump($x->test());
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Trait method test has not been applied, because there are collisions with other trait methods on bar in %s on line %d
|