mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +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
460 B
PHP
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
|