3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = 'foo'; $bar = new stdClass; $bar->$foo = array(); $bar->$foo[0] = 42; var_dump($bar);
Output for 7.0.6 - 7.1.0
object(stdClass)#1 (1) { ["foo"]=> array(1) { [0]=> int(42) } }
Output for 5.5.35 - 5.6.28
object(stdClass)#1 (2) { ["foo"]=> array(0) { } ["f"]=> int(42) }