3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'H', 'E', 'L', 'L', 'O', ]; $string = implode("", $array); for ($i = 0; $i <= count($array); $i++) { echo substr($string, 0, $i)."\n"; }

preferences:
24.48 ms | 405 KiB | 5 Q