3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 'foo'; $bar = new stdClass; $bar->$foo = array(10,20,30); var_dump($bar); $bar->$foo[0] = 42; var_dump($bar);

preferences:
54.59 ms | 402 KiB | 5 Q