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($a, $b); $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"] = 777 $b[1]["number"] = 777 $b[2]["number"] = 777 $b[3]["number"] = 777 $b[4]["number"] = 777 $b[5]["number"] = 777 $b[6]["number"] = 777 $b[7]["number"] = 777 $b[8]["number"] = 777 $b[9]["number"] = 777 $b[10]["number"] = 777 $b[11]["number"] = 777 $b[12]["number"] = 777 $b[13]["number"] = 777 $b[14]["number"] = 777 $b[15]["number"] = 777 $b[16]["number"] = 777 $b[17]["number"] = 777 $b[18]["number"] = 777 $b[19]["number"] = 777 $b[20]["number"] = 777 $b[21]["number"] = 777 $b[22]["number"] = 777 $b[23]["number"] = 777 $b[24]["number"] = 777 $b[25]["number"] = 777 $b[26]["number"] = 777 $b[27]["number"] = 777 $b[28]["number"] = 777 $b[29]["number"] = 777 $b[30]["number"] = 777 $b[31]["number"] = 777 $b[32]["number"] = 777 $b[33]["number"] = 777 $b[34]["number"] = 777 $b[35]["number"] = 777 $b[36]["number"] = 777 $b[37]["number"] = 777 $b[38]["number"] = 777 $b[39]["number"] = 777 $b[40]["number"] = 777 $b[41]["number"] = 777 $b[42]["number"] = 777 $b[43]["number"] = 777 $b[44]["number"] = 777 $b[45]["number"] = 777 $b[46]["number"] = 777 $b[47]["number"] = 777 $b[48]["number"] = 777 $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/mDF1a 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/mDF1a on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/mDF1a on line 2
Process exited with code 255.