2010-04-15 21:39:20 +00:00
|
|
|
--TEST--
|
|
|
|
In instead definitions all trait whose methods are meant to be hidden can be listed.
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
|
|
|
trait A {
|
|
|
|
public function foo() {
|
|
|
|
echo 'a';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
trait B {
|
|
|
|
public function foo() {
|
|
|
|
echo 'b';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
trait C {
|
|
|
|
public function foo() {
|
|
|
|
echo 'c';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-09 11:13:27 +00:00
|
|
|
class MyClass {
|
2010-04-15 21:39:20 +00:00
|
|
|
use C, A, B {
|
2010-04-22 21:56:55 +00:00
|
|
|
B::foo insteadof A, C;
|
2010-04-15 21:39:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-09 11:13:27 +00:00
|
|
|
$t = new MyClass;
|
2010-04-15 21:39:20 +00:00
|
|
|
$t->foo();
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
|
|
|
b
|