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.
21 lines
701 B
21 lines
701 B
<?php
|
|
|
|
use TypePhp\CompilerTest;
|
|
|
|
final class VariadicFixedArgumentsTest extends BaseTest
|
|
{
|
|
public function testFixedArgumentsInitializeTheArrayBeforeVariadicMerge(): void
|
|
{
|
|
global $translator;
|
|
$compiler = CompilerTest::create(TYPEPHP_ROOT_PATH);
|
|
$translator = $compiler;
|
|
$source = TYPEPHP_ROOT_PATH . '/phpunit/code/variadic-fixed-arguments.php';
|
|
$compiler->addFiles([$source]);
|
|
$compiler->prepareFile($source);
|
|
$code = file_get_contents($compiler->convertFile($source));
|
|
self::assertMatchesRegularExpression(
|
|
'/(tmp_var_\d+) = php::Array\{\s*head\s*\};\s*\1\.merge\(tail\);/',
|
|
$code,
|
|
);
|
|
}
|
|
}
|
|
|