src/Utils/IterableUtils.php
public static function last(array $arr, callable $callback)
    {
        $arrLength = count($arr);

        if ($arrLength === 0) {
            return null;
        }

        $index = $arrLength - 1;

        while($index >= 0) {
            if ($callback($arr[$index], $index) === true) {
                return $arr[$index];
            }
            $index--;
        }

        return null;
    }
public static function last(array $arr, callable $callback)
    {
        $arrLength = count($arr);

        if ($arrLength === 0) {
            return null;
        }

        $index = $arrLength - 1;

        while($index >= 0) {
            if ($callback($arr[$index], $index) === true) {
                return $arr[$index];
            }
            $index--;
        }

        return null;
    }
public static function last ( array $ arr , callable $ callback ) { $ arrLength = count ( $ arr ) ; if ( $ arrLength === 0 ) { return null ; } $ index = $ arrLength - 1 ; while ( $ index >= 0 ) { if ( $ callback ( $ arr [ $ index ] , $ index ) === true ) { return $ arr [ $ index ] ; } $ index -- ; } return null ; }
Find a value in array. Return the last found

@param array $arr The array to be used
@param callable $callback Function fired in array elements
@return mixed
Find a value in array . Return the last found