3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( array( 'x' => 0, 'y' => 1 ), array( 'x' => 2, 'y' => 3 ), array( 'x' => 0, 'y' => 1 ), array( 'x' => 2, 'y' => 3 ), array( 'x' => 0, 'y' => 1 ), array( 'x' => 2, 'y' => 3 ), array( 'x' => 0, 'y' => 1 ), array( 'x' => 2, 'y' => 3 ), array( 'x' => 0, 'y' => 1 ), array( 'x' => 2, 'y' => 3 ), array( 'x' => 0, 'y' => 1 ), array( 'x' => 2, 'y' => 3 ) ); foreach ($a as $id => &$b) { $b['x'] += 10; $b['y'] -= 10; } print_r($a);
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [x] => 10 [y] => -9 ) [1] => Array ( [x] => 12 [y] => -7 ) [2] => Array ( [x] => 10 [y] => -9 ) [3] => Array ( [x] => 12 [y] => -7 ) [4] => Array ( [x] => 10 [y] => -9 ) [5] => Array ( [x] => 12 [y] => -7 ) [6] => Array ( [x] => 10 [y] => -9 ) [7] => Array ( [x] => 12 [y] => -7 ) [8] => Array ( [x] => 10 [y] => -9 ) [9] => Array ( [x] => 12 [y] => -7 ) [10] => Array ( [x] => 10 [y] => -9 ) [11] => Array ( [x] => 12 [y] => -7 ) )
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected '&', expecting T_VARIABLE or '$' in <b>/in/92KIL</b> on line <b>53</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected '&', expecting T_VARIABLE or '$' in <b>/in/92KIL</b> on line <b>53</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_VARIABLE' or `'$'' in <b>/in/92KIL</b> on line <b>53</b><br />
Process exited with code 255.