3v4l.org

run code in 200+ 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 - 7.2.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 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.