Voting

: max(zero, three)?
(Example: nine)

The Note You're Voting On

contact at duzun dot me
6 years ago
Try to beat this polyfill in terms of performance!

<?php
if( !function_exists('array_key_last') ) {
function
array_key_last(array $array) {
if( !empty(
$array) ) return key(array_slice($array, -1, 1, true));
}
}

// Bonus
if (!function_exists('array_key_first')) {
function
array_key_first(array $arr) {
foreach(
$arr as $key => $unused) return $key;
}
}
?>

<< Back to user notes page

To Top