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.
 
 

32 lines
565 B

--TEST--
AOT invalid throw object matches PHP error
--FILE--
<?php
function throw_non_throwable_object(): void
{
throw new stdClass();
}
function throw_mixed(mixed $value): void
{
throw $value;
}
function main(): void
{
try {
throw_mixed(1);
} catch (Error $e) {
var_dump($e->getMessage());
}
try {
throw_non_throwable_object();
} catch (Error $e) {
var_dump($e->getMessage());
}
}
?>
--EXPECT--
string(22) "Can only throw objects"
string(52) "Cannot throw objects that do not implement Throwable"