3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array("a", "b", "c", "d", "e"); $len = count($input); $firsthalf = array_slice($input, 0, intval($len / 2)); $secondhalf = array_slice($input, intval($len / 2)); var_dump($firsthalf, $secondhalf);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
154.73 ms | 3392 KiB | 10 Q