3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [0 => 1, 1 => 2, 2 => 3]; $obj = (object) $arr; var_dump($obj);

preferences:
46.3 ms | 404 KiB | 5 Q