update page now

Voting

: six minus one?
(Example: nine)

The Note You're Voting On

github / k-gun
6 years ago
For those who loves tested candies;

<?php
function array_key_last(array $array) {
    // 100000 iters: ~0.068 secs
    return key(array_slice($array, -1));
    // 100000 iters: ~0.070 secs
    return key(array_reverse($array));
    // 100000 iters: ~0.088 secs
    return array_keys($array)[count($array) - 1] ?? null;
}
?>

<< Back to user notes page

To Top