3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array('leg1'=>'LA', 'leg2'=>'NY', 'leg3'=>'NY', 'leg4'=>'NY', 'leg5'=>'FL'); $keys = array_keys($array); for ($i = 0; $i < count($keys); $i++) { $cur = $array[$keys[$i]]; $next = $array[$keys[$i+1]]; }
based on ucurh
Output for 5.3.18 - 7.2.0
Notice: Undefined offset: 5 in /in/qWMe8 on line 7 Notice: Undefined index: in /in/qWMe8 on line 7