3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo implode(',', array_slice(explode(',', '1,2,3,4,5,6,7', 4 + 1), 0, 4));

preferences:
24.34 ms | 406 KiB | 5 Q