bug81192.phpt 395 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #81192: "Declaration should be compatible with" gives incorrect line number with traits
  3. --FILE--
  4. <?php
  5. require __DIR__ . '/bug81192_trait.inc';
  6. class A {
  7. public function foo(): int {
  8. return 2;
  9. }
  10. }
  11. class B extends A {
  12. use T;
  13. }
  14. ?>
  15. --EXPECTF--
  16. Fatal error: Declaration of T::foo(): string must be compatible with A::foo(): int in %sbug81192_trait.inc on line 4