3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ["aaa" => 1, "bbb" => 2, "ccc" => 3]; foreach(array_slice($arr,0,-1) as $val){ echo $val; }

preferences:
28.55 ms | 404 KiB | 5 Q