original_string: public function filter(callable $callback = null)
      {
          if (is_null($callback)) {
              return new static($this->classname, array_filter($this->items));
          }
  
          return new static($this->classname, array_filter($this->items, $callback));
      }
code: public function filter(callable $callback = null)
      {
          if (is_null($callback)) {
              return new static($this->classname, array_filter($this->items));
          }
  
          return new static($this->classname, array_filter($this->items, $callback));
      }
code_tokens: public function filter ( callable $ callback = null ) { if ( is_null ( $ callback ) ) { return new static ( $ this -> classname , array_filter ( $ this -> items ) ) ; } return new static ( $ this -> classname , array_filter ( $ this -> items , $ callback ) ) ; }
docstring: Filter the elements in the collection using a callback function.
  
  @param callable|null $callback
  
  @return static
docstring_tokens: Filter the elements in the collection using a callback function .