abstract-methods01.phpt 412 B

12345678910111213141516171819
  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. }
  12. $test = new TraitsTest();
  13. $test->hello();
  14. ?>
  15. --EXPECTF--
  16. Fatal error: Class %s contains %d abstract method and must therefore be declared abstract or implement the remaining methods (%s) in %s on line %d