mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
0585548106
Abstract ctor signatures should always be respected by all children, independently of whether it comes from an interface or an abstract class. Previously abstract ctor signatures (if they didn't come from an interface) were only checked to one level of inheritance.
19 lines
409 B
PHP
19 lines
409 B
PHP
--TEST--
|
|
LSP checks are performed against an abstract constructor even if it is not a direct parent
|
|
--FILE--
|
|
<?php
|
|
|
|
abstract class A {
|
|
abstract function __construct(X $x);
|
|
}
|
|
class B extends A {
|
|
function __construct(X $x) {}
|
|
}
|
|
class C extends B {
|
|
function __construct() {}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Declaration of C::__construct() must be compatible with A::__construct(X $x) in %s on line 10
|