3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = [['number'=>777]]; $b = []; for ($i = 0; $i < 50; ++$i) { //$b += $a; $b = array_merge($b, $a); $b[$i]['number'] = $i; } array_walk($b, function($val, $key) { echo '$b[' . $key . ']["number"] = ' . $val['number'] . PHP_EOL; });
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
$b[0]["number"] = 0 $b[1]["number"] = 1 $b[2]["number"] = 2 $b[3]["number"] = 3 $b[4]["number"] = 4 $b[5]["number"] = 5 $b[6]["number"] = 6 $b[7]["number"] = 7 $b[8]["number"] = 8 $b[9]["number"] = 9 $b[10]["number"] = 10 $b[11]["number"] = 11 $b[12]["number"] = 12 $b[13]["number"] = 13 $b[14]["number"] = 14 $b[15]["number"] = 15 $b[16]["number"] = 16 $b[17]["number"] = 17 $b[18]["number"] = 18 $b[19]["number"] = 19 $b[20]["number"] = 20 $b[21]["number"] = 21 $b[22]["number"] = 22 $b[23]["number"] = 23 $b[24]["number"] = 24 $b[25]["number"] = 25 $b[26]["number"] = 26 $b[27]["number"] = 27 $b[28]["number"] = 28 $b[29]["number"] = 29 $b[30]["number"] = 30 $b[31]["number"] = 31 $b[32]["number"] = 32 $b[33]["number"] = 33 $b[34]["number"] = 34 $b[35]["number"] = 35 $b[36]["number"] = 36 $b[37]["number"] = 37 $b[38]["number"] = 38 $b[39]["number"] = 39 $b[40]["number"] = 40 $b[41]["number"] = 41 $b[42]["number"] = 42 $b[43]["number"] = 43 $b[44]["number"] = 44 $b[45]["number"] = 45 $b[46]["number"] = 46 $b[47]["number"] = 47 $b[48]["number"] = 48 $b[49]["number"] = 49
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/8VMgL on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/8VMgL on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/8VMgL on line 2
Process exited with code 255.