3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = "cool"; $tester = new stdClass(); $tester->$test = array(); for($i=0;$i<10;$i++){ array_push($tester->$test,$i); } print_r($tester);
based on JgITL
Output for 4.3.0 - 7.2.0
stdClass Object ( [cool] => Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 ) )