php-src/Zend/tests/traits/flattening002.phpt

29 lines
402 B
Plaintext
Raw Normal View History

--TEST--
2018-10-14 16:03:31 +00:00
parent:: works like in a method defined without traits.
--FILE--
<?php
error_reporting(E_ALL);
class Base {
public function sayHello() {
echo 'Hello ';
}
}
2018-09-16 17:16:42 +00:00
trait SayWorld {
public function sayHello() {
parent::sayHello();
echo 'World!';
}
}
class MyHelloWorld extends Base {
use SayWorld;
}
$o = new MyHelloWorld();
$o->sayHello();
?>
2018-09-16 17:16:42 +00:00
--EXPECT--
Hello World!