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
692 B
32 lines
692 B
--TEST--
|
|
std vector: exact class value type rejects non-object value
|
|
--FILE--
|
|
<?php
|
|
class StdVectorRuntimeScalarValue
|
|
{
|
|
}
|
|
|
|
function std_vector_runtime_scalar_mixed(mixed $value): mixed
|
|
{
|
|
return $value;
|
|
}
|
|
|
|
function main() {
|
|
$vector = std::vector(StdVectorRuntimeScalarValue::class);
|
|
|
|
try {
|
|
$vector[] = std_vector_runtime_scalar_mixed(123);
|
|
} catch (Throwable $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
$vector[] = std_vector_runtime_scalar_mixed(null);
|
|
} catch (Throwable $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
The parameter `object` must be `object`, got `int`
|
|
The parameter `object` must be `object`, got `null`
|
|
|