3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $locales = array( 0 => 'EN', 1 => 'DE', 2 => 'AR', '3'=>'BA' ); foreach($locales as $key => $code){ if($code == 'DE'){ unset($locales[$key]); } var_dump(current($locales)); } var_dump(current($locales)); // bool(false)
based on gGZkb
Output for 4.3.0 - 4.4.0, 4.4.2 - 5.0.5, 5.1.1 - 5.2.3, 7.0.0 - 7.3.0alpha1
string(2) "EN" string(2) "EN" string(2) "EN" string(2) "EN" string(2) "EN"
Output for 5.2.4 - 5.6.28
string(2) "DE" string(2) "AR" string(2) "AR" string(2) "AR" string(2) "AR"
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/t87UU on line 15
Process exited with code 255.
Output for 4.4.1
string(2) "DE" string(2) "EN" string(2) "EN" string(2) "EN" string(2) "EN"