3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr[0]="page0"; $arr[1]="page1"; $arr[2]="page2"; $arr[3]="goal"; $arr[4]="page4"; echo implode(" ---> ", array_slice($arr, 0, array_search("goal",$arr)+1));

preferences:
57.66 ms | 406 KiB | 5 Q