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[$i]['number'] = $i; } array_walk($b, function($val, $key) { echo '$b[' . $val . ']["number"] = ' . $val['number']; });
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
$b[777]["number"] = Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 0 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 1 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 2 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 3 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 4 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 5 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 6 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 7 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 8 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 9 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 10 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 11 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 12 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 13 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 14 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 15 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 16 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 17 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 18 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 19 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 20 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 21 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 22 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 23 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 24 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 25 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 26 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 27 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 28 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 29 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 30 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 31 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 32 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 33 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 34 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 35 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 36 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 37 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 38 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 39 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 40 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 41 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 42 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 43 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 44 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 45 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 46 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 47 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 48 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 49
Output for hhvm-3.10.0 - 3.12.0
$b[777]["number"] = Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 0 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 1 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 2 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 3 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 4 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 5 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 6 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 7 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 8 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 9 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 10 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 11 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 12 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 13 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 14 Notice: Array to string conversion in /in/1Wftl on line 8 $b[Array]["number"] = 15$b[Array]["number"] = 16$b[Array]["number"] = 17$b[Array]["number"] = 18$b[Array]["number"] = 19$b[Array]["number"] = 20$b[Array]["number"] = 21$b[Array]["number"] = 22$b[Array]["number"] = 23$b[Array]["number"] = 24$b[Array]["number"] = 25$b[Array]["number"] = 26$b[Array]["number"] = 27$b[Array]["number"] = 28$b[Array]["number"] = 29$b[Array]["number"] = 30$b[Array]["number"] = 31$b[Array]["number"] = 32$b[Array]["number"] = 33$b[Array]["number"] = 34$b[Array]["number"] = 35$b[Array]["number"] = 36$b[Array]["number"] = 37$b[Array]["number"] = 38$b[Array]["number"] = 39$b[Array]["number"] = 40$b[Array]["number"] = 41$b[Array]["number"] = 42$b[Array]["number"] = 43$b[Array]["number"] = 44$b[Array]["number"] = 45$b[Array]["number"] = 46$b[Array]["number"] = 47$b[Array]["number"] = 48$b[Array]["number"] = 49
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/1Wftl 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/1Wftl on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/1Wftl on line 2
Process exited with code 255.