2010-04-15 21:39:20 +00:00
|
|
|
--TEST--
|
2011-11-17 21:04:15 +00:00
|
|
|
Aliasing on conflicting method should not cover up conflict.
|
2010-04-15 21:39:20 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
|
|
|
trait Hello {
|
|
|
|
public function sayHello() {
|
|
|
|
echo 'Hello';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
trait World {
|
|
|
|
public function sayHello() {
|
|
|
|
echo ' World!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class MyClass {
|
|
|
|
use Hello, World { sayHello as sayWorld; }
|
|
|
|
}
|
|
|
|
|
|
|
|
$o = new MyClass();
|
|
|
|
$o->sayHello();
|
|
|
|
$o->sayWorld();
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2011-11-17 21:04:15 +00:00
|
|
|
Fatal error: Trait method sayHello has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
|