mirror of
https://github.com/php/php-src.git
synced 2024-09-24 03:17:26 +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
25 lines
418 B
PHP
25 lines
418 B
PHP
--TEST--
|
|
Method conflict in traits
|
|
--FILE--
|
|
<?php
|
|
error_reporting(E_ALL);
|
|
|
|
trait THello1 {
|
|
private function hello() {
|
|
echo 'Hello';
|
|
}
|
|
}
|
|
|
|
trait THello2 {
|
|
private function hello() {
|
|
echo 'Hello';
|
|
}
|
|
}
|
|
|
|
class TraitsTest {
|
|
use THello1;
|
|
use THello2;
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on TraitsTest in %s on line %d
|