php-src/Zend/tests/bug61970_2.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
460 B
PHP

--TEST--
Bug #61970 (Restraining __construct() access level in subclass gives a fatal error - stays when inheriting implemented abstract)
--FILE--
<?php
abstract class Foo {
abstract public function __construct();
}
class Bar extends Foo {
public function __construct(){}
}
class Baz extends Bar {
protected function __construct(){}
}
--EXPECTF--
Fatal error: Access level to Baz::__construct() must be public (as in class Foo) in %s on line 12