summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/language002.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/traits/language002.phpt')
-rw-r--r--Zend/tests/traits/language002.phpt32
1 files changed, 32 insertions, 0 deletions
diff --git a/Zend/tests/traits/language002.phpt b/Zend/tests/traits/language002.phpt
new file mode 100644
index 0000000..d093f29
--- /dev/null
+++ b/Zend/tests/traits/language002.phpt
@@ -0,0 +1,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();
+?>
+--EXPECTF--
+Hello World! \ No newline at end of file