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.
22 lines
386 B
22 lines
386 B
--TEST--
|
|
constructor property promotion runs even when the constructor contains yield
|
|
--FILE--
|
|
<?php
|
|
class PromotedGeneratorConstructor
|
|
{
|
|
public function __construct(public int $value)
|
|
{
|
|
if (false) {
|
|
yield 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
$object = new PromotedGeneratorConstructor(42);
|
|
var_dump($object->value);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(42)
|
|
|