mirror of
https://github.com/php/php-src.git
synced 2024-12-15 04:45:03 +08:00
46de334452
This reverts commit b67eb3440b
.
19 lines
476 B
PHP
19 lines
476 B
PHP
--TEST--
|
|
Bug #73987 (Method compatibility check looks to original definition and not parent - return types interface)
|
|
--FILE--
|
|
<?php
|
|
|
|
interface I {
|
|
public function example();
|
|
}
|
|
class A implements I {
|
|
public function example(): int { } // compatible with I::example
|
|
}
|
|
class B extends A {
|
|
public function example(): string { } // compatible with I::example
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Declaration of B::example(): string must be compatible with A::example(): int in %s
|