3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Create a simple array. $array = array(1, 2, 3, 4, 5); //print_r($array); // Now delete every item, but leave the array itself intact: foreach ($array as $i => $value) { echo "key ".$i.", Value=".$array[$i]; } //print_r($array); ?>
based on 16ZLR
Output for 5.3.18 - 7.2.0
key 0, Value=1key 1, Value=2key 2, Value=3key 3, Value=4key 4, Value=5