3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array( 'fruit1' => 'apple', 'fruit2' => 'orange', 'fruit3' => 'grape', 'fruit4' => 'apple', 'fruit5' => 'apple'); foreach($array as $value) { $mykey = key($array); print_r($mykey); }
based on nXYpY
Output for 7.0.0 - 7.2.0
fruit1fruit1fruit1fruit1fruit1
Output for 5.3.19 - 5.6.28
fruit2fruit2fruit2fruit2fruit2