abstract-methods05.phpt 429 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. The compatibility with the signature of abstract methods should be checked.
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. trait THelloB {
  7. public function hello() {
  8. echo 'Hello';
  9. }
  10. }
  11. trait THelloA {
  12. public abstract function hello($a);
  13. }
  14. class TraitsTest1 {
  15. use THelloB;
  16. use THelloA;
  17. }
  18. ?>
  19. --EXPECTF--
  20. Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d