summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/flattening003.phpt
blob: d189ca70c1858898c4e8cc6ea2ade0fac856fa79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--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!