1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Files
archived-php-src/Zend/tests/traits/error_011.phpt
T
Nikita Popov d9219f997d Enable better trait conflict error message
I don't think there is any reason to disable this anymore,
at least all the messages generated in tests look correct and
more useful.
2020-03-10 16:19:11 +01:00

27 lines
421 B
PHP

--TEST--
Testing trait collisions
--FILE--
<?php
trait foo {
public function test() { return 3; }
}
trait c {
public function test() { return 2; }
}
trait b {
public function test() { return 1; }
}
class bar {
use foo, c, b;
}
$x = new bar;
var_dump($x->test());
?>
--EXPECTF--
Fatal error: Trait method c::test has not been applied as bar::test, because of collision with foo::test in %s on line %d