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.
35 lines
825 B
35 lines
825 B
--TEST--
|
|
include/require unwind safely when ZendVM calls a compiled function that throws
|
|
--ENV--
|
|
PHPRC=tests/compiler/include_require/no-leak.ini
|
|
--FILE--
|
|
<?php
|
|
declare(strict_types=1);
|
|
function Hello(string $value) {}
|
|
|
|
function includePath(string $name): string
|
|
{
|
|
return implode('', [__DIR__, '/', ucfirst(strtolower($name)), '.php']);
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
// Keep this name: generated helper variables must not collide with PHP locals.
|
|
$filename = includePath('hello');
|
|
|
|
try {
|
|
include $filename;
|
|
} catch (ArgumentCountError $e) {
|
|
echo "include ArgumentCountError\n";
|
|
}
|
|
|
|
try {
|
|
require includePath('hello');
|
|
} catch (ArgumentCountError $e) {
|
|
echo "require ArgumentCountError\n";
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
include ArgumentCountError
|
|
require ArgumentCountError
|
|
|