Returns all the elements of this collection that satisfy the predicate p. The order of the elements is preserved.
Closure $p The predicate used for filtering.:
Collection A collection with the results of the filter operation.
Overrides Collection::filter
public function filter(Closure $p) {
return new static(array_filter($this->_elements, $p));
}