3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['EzEz' => 1, 'EzFY' => 2, 'FYEz' => 3]; $ref =& $array; foreach ($array as $value) { unset($array['EzFY']); $array['FYFY'] = 4; var_dump($value); } // output: 1, 4
based on Jv5T5
Output for 7.0.0 - 7.3.0alpha1
int(1) int(2) int(3)
Output for 5.4.11 - 5.6.28
int(1) int(4)
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/VpeTU on line 3
Process exited with code 255.