TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
456 B
37 lines
456 B
--TEST--
|
|
Trait protected __construct is accessible from a subclass
|
|
--FILE--
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
trait TestTrait
|
|
{
|
|
protected function __construct()
|
|
{
|
|
echo "base ctor\n";
|
|
}
|
|
}
|
|
|
|
class BaseClass
|
|
{
|
|
use TestTrait;
|
|
}
|
|
|
|
class SubClass extends BaseClass
|
|
{
|
|
public function __construct()
|
|
{
|
|
new BaseClass();
|
|
echo "sub ctor\n";
|
|
}
|
|
}
|
|
|
|
function main()
|
|
{
|
|
new SubClass();
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
base ctor
|
|
sub ctor
|
|
|