src/mako/utility/Collection.php
public function filter(?callable $callable = null)
	{
		if($callable === null)
		{
			return new static(array_filter($this->items));
		}

		return new static(array_filter($this->items, $callable, ARRAY_FILTER_USE_BOTH));
	}
public function filter(?callable $callable = null)
	{
		if($callable === null)
		{
			return new static(array_filter($this->items));
		}

		return new static(array_filter($this->items, $callable, ARRAY_FILTER_USE_BOTH));
	}
public function filter ( ? callable $ callable = null ) { if ( $ callable === null ) { return new static ( array_filter ( $ this -> items ) ) ; } return new static ( array_filter ( $ this -> items , $ callable , ARRAY_FILTER_USE_BOTH ) ) ; }
Returns a new filtered collection.

@param  callable|null $callable Filter
@return static
Returns a new filtered collection .