mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
b501570ab0
#Getting accustomed to the infrastructure. #Any comments are welcome, especially with regard to syntax and keywords.
32 lines
400 B
PHP
32 lines
400 B
PHP
--TEST--
|
|
Traits are flattened recurivly.
|
|
--FILE--
|
|
<?php
|
|
error_reporting(E_ALL);
|
|
|
|
trait Hello {
|
|
public function sayHello() {
|
|
echo 'Hello ';
|
|
}
|
|
}
|
|
|
|
trait World {
|
|
public function sayWorld() {
|
|
echo 'World!';
|
|
}
|
|
}
|
|
|
|
trait HelloWorld {
|
|
use Hello, World;
|
|
}
|
|
|
|
class MyHelloWorld {
|
|
use HelloWorld;
|
|
}
|
|
|
|
$o = new MyHelloWorld();
|
|
$o->sayHello();
|
|
$o->sayWorld();
|
|
?>
|
|
--EXPECTF--
|
|
Hello World!
|