3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(1=>"a",2=>"b",3=>"c",4=>"d"); foreach($a as $key=>$value) { $a[$key]=$value+2; } print_r($a);
based on A82Qj
Output for 7.1.0 - 7.2.0
Warning: A non-numeric value encountered in /in/HShdg on line 5 Warning: A non-numeric value encountered in /in/HShdg on line 5 Warning: A non-numeric value encountered in /in/HShdg on line 5 Warning: A non-numeric value encountered in /in/HShdg on line 5 Array ( [1] => 2 [2] => 2 [3] => 2 [4] => 2 )
Output for 5.3.18 - 7.0.20
Array ( [1] => 2 [2] => 2 [3] => 2 [4] => 2 )