3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 1; $obj = new stdClass; $obj->$key = 'val'; $arr = (array) $obj; var_dump($arr); var_dump($key); var_dump(isset($arr[$key]));

preferences:
40.22 ms | 402 KiB | 5 Q