3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'fruit1' => 'apple', 'fruit2' => 'orange', 'fruit3' => 'grape', 'fruit4' => 'apple', 'fruit5' => 'apple'); foreach($array as $value) { $mykey = key($array); print_r($mykey); }

preferences:
43.03 ms | 402 KiB | 5 Q