php-src/Zend/tests/traits/language003.phpt
Stefan Marr 05a9649043 Changed the exclusion keyword from 'instead' to 'insteadof'. [TRAITS]
#That was suggested several times already, but am still not sure whether that really reads better.
#Especially since only the trait is mentioned, since the method name would be duplicated anyway.
2010-04-22 21:56:55 +00:00

29 lines
397 B
PHP

--TEST--
Use instead to solve a conflict.
--FILE--
<?php
error_reporting(E_ALL);
trait Hello {
public function saySomething() {
echo 'Hello';
}
}
trait World {
public function saySomething() {
echo 'World';
}
}
class MyHelloWorld {
use Hello, World {
Hello::saySomething insteadof World;
}
}
$o = new MyHelloWorld();
$o->saySomething();
?>
--EXPECTF--
Hello