abstract-methods03.phpt 318 B

12345678910111213141516171819202122
  1. --TEST--
  2. Abstract Trait Methods should behave like common abstract methods.
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. trait THello {
  7. public abstract function hello();
  8. }
  9. class TraitsTest {
  10. use THello;
  11. public function hello() {
  12. echo 'Hello';
  13. }
  14. }
  15. $test = new TraitsTest();
  16. $test->hello();
  17. ?>
  18. --EXPECT--
  19. Hello