3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tx = ["ans1","ans2","ans3"]; for ($i=0, $max=3; $i < $max; $i++) { $o[] = new stdClass; $o[$i] = $tx[$i]; } print_r( $o );
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
Array ( [0] => ans1 [1] => ans2 [2] => ans3 )