public static function lastIndexOf($array, $item)
    {
        if (is_array($array))
            return ($keys = array_keys($array, $item, false)) ? array_pop($keys) : -1;

        $found = -1;
        $search = $item;
        static::each($array, function($item, $key) use ($search, & $found) {
            if ($item == $search)
                $found = $key;
        });

        return $found;
    }
public static function lastIndexOf($array, $item)
    {
        if (is_array($array))
            return ($keys = array_keys($array, $item, false)) ? array_pop($keys) : -1;

        $found = -1;
        $search = $item;
        static::each($array, function($item, $key) use ($search, & $found) {
            if ($item == $search)
                $found = $key;
        });

        return $found;
    }
public static function lastIndexOf ( $ array , $ item ) { if ( is_array ( $ array ) ) return ( $ keys = array_keys ( $ array , $ item , false ) ) ? array_pop ( $ keys ) : - 1 ; $ found = - 1 ; $ search = $ item ; static :: each ( $ array , function ( $ item , $ key ) use ( $ search , & $ found ) { if ( $ item == $ search ) $ found = $ key ; } ) ; return $ found ; }
Returns the index of the last occurrence of value in the array, or -1 if value is not present. This method uses
array_keys internally and is not optimized for long array binary search.

@category Array Functions

@param traversable $array the list of items
@param mixed $item the value to look for

@return mixed
Returns the index of the last occurrence of value in the array or - 1 if value is not present . This method uses array_keys internally and is not optimized for long array binary search .