diff options
Diffstat (limited to 'Zend/tests/traits/language003.phpt')
-rw-r--r-- | Zend/tests/traits/language003.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Zend/tests/traits/language003.phpt b/Zend/tests/traits/language003.phpt new file mode 100644 index 0000000..77d4429 --- /dev/null +++ b/Zend/tests/traits/language003.phpt @@ -0,0 +1,29 @@ +--TEST-- +Use instead to solve a conflict. +--FILE-- +<?php +error_reporting(E_ALL); + +trait Hello { + public function saySomething() { + echo 'Hello'; + } +} + +trait World { + public function saySomething() { + echo 'World'; + } +} + +class MyHelloWorld { + use Hello, World { + Hello::saySomething insteadof World; + } +} + +$o = new MyHelloWorld(); +$o->saySomething(); +?> +--EXPECTF-- +Hello
\ No newline at end of file |