public static function filter(array $array, $callback = null, $default = [], $length = null)
    {
        // Set result array
        $result = [];

        // Check callback
        if (is_callable($callback)) {
            // Filter array elements
            foreach ($array as $key => $value) {
                if (call_user_func($callback, $key, $value)) {
                    $result[$key] = $value;
                }
            }
        } else {
            reset($array);

            $result = empty($array) ? null : $array;
        }

        // Return result array or default value
        return $result ? array_slice($result, 0, $length) : EvalHelper::evaluate($default);
    }