php-src/Zend/tests/constructor_abstract_grantparent.phpt
Nikita Popov 0585548106 Treat abstract ctors the same, regardless of origin
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.
2019-03-27 18:09:09 +01:00

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