3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["1", "2", "3", "4", "5"]; $removed = array_splice( $array, -(count($array) >> 1) ); var_export([ 'first half' => $array, 'second half' => $removed ]);

preferences:
54.89 ms | 858 KiB | 5 Q