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.
36 lines
502 B
36 lines
502 B
--TEST--
|
|
Trait constructor calling parent::__construct of the composing class
|
|
--FILE--
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
trait TestTrait
|
|
{
|
|
public function __construct(int $value)
|
|
{
|
|
parent::__construct($value, true);
|
|
}
|
|
}
|
|
|
|
class ParentClass
|
|
{
|
|
public function __construct(int $value, bool $bool)
|
|
{
|
|
var_dump($value, $bool);
|
|
}
|
|
}
|
|
|
|
class TestClass extends ParentClass
|
|
{
|
|
use TestTrait;
|
|
}
|
|
|
|
function main()
|
|
{
|
|
new TestClass(123);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(123)
|
|
bool(true)
|
|
|