summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/language002.phpt
blob: ac29e2a12404cb43a19d6eacaf955caf9ca75464 (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--
Use multiple traits.
--FILE--
<?php
error_reporting(E_ALL);

trait Hello {
   public function sayHello() {
     echo 'Hello ';
   }
}

trait World {
   public function sayWorld() {
     echo 'World';
   }
}

class MyHelloWorld {
   use Hello, World;
   public function sayExclamationMark() {
     echo '!';
   }
}

$o = new MyHelloWorld();
$o->sayHello();
$o->sayWorld();
$o->sayExclamationMark();
?>
--EXPECT--
Hello World!