3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for ($i = 1; $i <= 5; $i++) { $ratingOpt[] = array('key' => $i, 'value' => $i); } var_dump($ratingOpt);
Output for 4.3.0 - 7.1.0
array(5) { [0]=> array(2) { ["key"]=> int(1) ["value"]=> int(1) } [1]=> array(2) { ["key"]=> int(2) ["value"]=> int(2) } [2]=> array(2) { ["key"]=> int(3) ["value"]=> int(3) } [3]=> array(2) { ["key"]=> int(4) ["value"]=> int(4) } [4]=> array(2) { ["key"]=> int(5) ["value"]=> int(5) } }