3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = array( "one" => 1, 2 => 1, "three" => 1, "four" => 1, 5 => 1 ); foreach($x as $key => $y){ $x[$key]=$y++; } var_dump($x);
based on X6tvd
Output for 4.3.0 - 7.2.0
array(5) { ["one"]=> int(1) [2]=> int(1) ["three"]=> int(1) ["four"]=> int(1) [5]=> int(1) }