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.
 
 

30 lines
518 B

--TEST--
std orderedMap: unsafe_cast
--FILE--
<?php
function std_map_unsafe_ptr_update($source): void
{
$map = $source->toStdOrderedMap(Type::String, Type::Int);
var_dump($map["b"]);
$map["c"] = 9;
unset($source);
$array = (array)$map;
var_dump(count($array));
}
function main() {
$map = std::orderedMap(Type::String, Type::Int);
$map["a"] = 1;
$map["b"] = 7;
$map["c"] = 3;
std_map_unsafe_ptr_update($map);
var_dump($map["c"]);
}
?>
--EXPECT--
int(7)
int(3)
int(9)