3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php <?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 $array['2']; } print_r($array); // Append an item (note that the new key is 5, instead of 0). $array[] = 6; print_r($array); // Re-index: $array = array_values($array); $array[] = 7; print_r($array);
Output for 5.3.0 - 5.5.2
Parse error: syntax error, unexpected '<' in /in/lQ2ZC on line 2
Process exited with code 255.