3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $range = []; for ($i = 1; $i < 14; $i++) { $range[$i] = $i; } var_dump($range); // VS $range = range(1, 14, 1); $range = array_combine($range, $range); var_dump($range);
Output for 5.4.11 - 7.2.0
array(13) { [1]=> int(1) [2]=> int(2) [3]=> int(3) [4]=> int(4) [5]=> int(5) [6]=> int(6) [7]=> int(7) [8]=> int(8) [9]=> int(9) [10]=> int(10) [11]=> int(11) [12]=> int(12) [13]=> int(13) } array(14) { [1]=> int(1) [2]=> int(2) [3]=> int(3) [4]=> int(4) [5]=> int(5) [6]=> int(6) [7]=> int(7) [8]=> int(8) [9]=> int(9) [10]=> int(10) [11]=> int(11) [12]=> int(12) [13]=> int(13) [14]=> int(14) }
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/kAHKk on line 3
Process exited with code 255.