src/Utils/IterableUtils.php
public static function filter(array $arr, callable $callback): array
    {
        $arrResult = [];

        foreach ($arr as $index => $value) {
            if ($callback($value, $index) === true) {
                $arrResult[] = $value;
            }
        }

        return $arrResult;
    }
public static function filter(array $arr, callable $callback): array
    {
        $arrResult = [];

        foreach ($arr as $index => $value) {
            if ($callback($value, $index) === true) {
                $arrResult[] = $value;
            }
        }

        return $arrResult;
    }
public static function filter ( array $ arr , callable $ callback ) : array { $ arrResult = [ ] ; foreach ( $ arr as $ index => $ value ) { if ( $ callback ( $ value , $ index ) === true ) { $ arrResult [ ] = $ value ; } } return $ arrResult ; }
Filter the array according callback

@param array $arr The array to be used
@param callable $callback Function fired in array elements
@return array The array filtered
Filter the array according callback