language001.phpt 255 B

123456789101112131415161718192021
  1. --TEST--
  2. Single Trait with simple trait method
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. trait THello {
  7. public function hello() {
  8. echo 'Hello';
  9. }
  10. }
  11. class TraitsTest {
  12. use THello;
  13. }
  14. $test = new TraitsTest();
  15. $test->hello();
  16. ?>
  17. --EXPECT--
  18. Hello