3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = ['bar' => 23, 'foo' => 42]; foreach ($foo as &$value) { $value = 33 + "-". $value; } var_dump($foo);
based on ZrAc3
Output for 7.1.0 - 7.2.0
Warning: A non-numeric value encountered in /in/6KKH6 on line 6 Warning: A non-numeric value encountered in /in/6KKH6 on line 6 array(2) { ["bar"]=> string(4) "3323" ["foo"]=> &string(4) "3342" }
Output for 5.4.9 - 7.0.20
array(2) { ["bar"]=> string(4) "3323" ["foo"]=> &string(4) "3342" }
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/6KKH6 on line 3
Process exited with code 255.