diff options
Diffstat (limited to 'Zend/tests/traits/language007.phpt')
-rw-r--r-- | Zend/tests/traits/language007.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Zend/tests/traits/language007.phpt b/Zend/tests/traits/language007.phpt new file mode 100644 index 0000000..3b65d01 --- /dev/null +++ b/Zend/tests/traits/language007.phpt @@ -0,0 +1,30 @@ +--TEST-- +Traits can fulfill the requirements of abstract base classes. +--FILE-- +<?php +error_reporting(E_ALL); + +abstract class Base { + abstract function sayWorld(); +} + +trait Hello { + public function sayHello() { + echo 'Hello'; + } + public function sayWorld() { + echo ' World!'; + } + } + +class MyHelloWorld extends Base { + use Hello; +} + +$o = new MyHelloWorld(); +$o->sayHello(); +$o->sayWorld(); + +?> +--EXPECTF-- +Hello World!
\ No newline at end of file |