3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(); $arr['b'] = 'book'; foreach($arr as $key=>$val) { print "key=>$key\n"; if(!isset($arr['a'])) $arr['a'] = 'apple'; } echo '<pre>'; print_r($arr);
Output for 4.3.0 - 7.1.0
key=>b <pre>Array ( [b] => book [a] => apple )