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
526 B
22 lines
526 B
--TEST--
|
|
std vector: unsafe_cast type mismatch
|
|
--FILE--
|
|
<?php
|
|
function std_vector_unsafe_ptr_type_mismatch(UnsafePtr $unsafePtr): void
|
|
{
|
|
$vector = std::unsafe_cast(std::vector(native_types::type_float), $unsafePtr);
|
|
}
|
|
|
|
function main() {
|
|
$vector = std::vector(native_types::type_int, 3);
|
|
$ptr = std::unsafe_ptr($vector);
|
|
|
|
try {
|
|
std_vector_unsafe_ptr_type_mismatch($ptr);
|
|
} catch (TypeError $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
std::unsafe_cast(): UnsafePtr type mismatch
|
|
|