3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["1", "2", "3", "4", "5"]; var_export( array_chunk($array, count($array) + 1 >> 1) );
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
array ( 0 => array ( 0 => '1', 1 => '2', 2 => '3', ), 1 => array ( 0 => '4', 1 => '5', ), )

preferences:
50.71 ms | 854 KiB | 4 Q