3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new stdClass; $obj->{123} = "foo"; // int 123 -> string "123" (object property) $arr = (array) $obj; $arr["123"] = "bar"; // string "123" -> int 123 (numeric array key) var_dump($arr);

preferences:
45.87 ms | 402 KiB | 5 Q