3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1 => '5ive', 'jim' => 'bob', 4 => 5); end($array); echo 'Pointer is set to: ' . current($array) . "\n"; echo 'first item: ' . array_slice($array, 0, 1)[0] . "\n"; echo 'Pointer is set to: ' . current($array) . "\n";

preferences:
39.84 ms | 402 KiB | 5 Q