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.
23 lines
323 B
23 lines
323 B
--TEST--
|
|
Object cast (object) from array
|
|
--FILE--
|
|
<?php
|
|
|
|
function main() {
|
|
$data = (object) ["name" => "test", "value" => 42];
|
|
var_dump($data->name);
|
|
var_dump($data->value);
|
|
|
|
$empty = (object) [];
|
|
var_dump((array) $empty);
|
|
|
|
echo "done\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(4) "test"
|
|
int(42)
|
|
array(0) {
|
|
}
|
|
done
|
|
|