abstract_method_10.phpt 346 B

12345678910111213141516171819
  1. --TEST--
  2. Abstract method in trait using "self" (invalid)
  3. --FILE--
  4. <?php
  5. trait T {
  6. abstract private function method(self $x): self;
  7. }
  8. class C {
  9. use T;
  10. private function method(int $x): int { }
  11. }
  12. ?>
  13. ===DONE===
  14. --EXPECTF--
  15. Fatal error: Declaration of C::method(int $x): int must be compatible with T::method(C $x): C in %s on line %d