php-src/Zend/tests/traits/language010.phpt
Stefan Marr 8ba00176f1 Fixed a inconsitent condition for aliasing traits.
- missed a failing Traits test, but is now fixed, and the bug covered by a dedicated test
# Should always comment conditions that go over more than two lines :-/
2011-05-13 20:28:34 +00:00

30 lines
509 B
PHP

--TEST--
Aliasing leading to conflict should result in error message
--FILE--
<?php
error_reporting(E_ALL);
trait Hello {
public function hello() {
echo 'Hello';
}
}
trait World {
public function world() {
echo ' World!';
}
}
class MyClass {
use Hello, World { hello as world; }
}
$o = new MyClass();
$o->hello();
$o->world();
?>
--EXPECTF--
Fatal error: Trait method world has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d