3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['a','b','c','d','e']; echo implode(', ', array_slice($array, 0, -1)) . ' and ' . end($array);

preferences:
62.96 ms | 406 KiB | 5 Q