Fusonic\Linq\Linq::any PHP Method

any() public method

Determines whether any element exists or satisfies a condition by invoking $func.
public any ( callable $func = null ) : boolean
$func callable A function to test each element for a condition or NULL to determine if any element exists.
return boolean True if no $func given and the source sequence contains any elements or True if any elements passed the test in the specified func; otherwise, false.
    public function any(callable $func = null)
    {
        foreach ($this->iterator as $current) {
            if ($func === null) {
                return true;
            }
            $match = LinqHelper::getBoolOrThrowException($func($current));
            if ($match) {
                return true;
            }
        }
        return false;
    }