original_string: public function filter(callable $callback = null)
      {
          foreach ($this->items as $key => $value) {
              if (
                  (!$callback && !(bool)$value) ||
                  ($callback && !$callback($value, $key))
              ) {
                  unset($this->items[$key]);
              }
          }
  
          return $this;
      }
code: public function filter(callable $callback = null)
      {
          foreach ($this->items as $key => $value) {
              if (
                  (!$callback && !(bool)$value) ||
                  ($callback && !$callback($value, $key))
              ) {
                  unset($this->items[$key]);
              }
          }
  
          return $this;
      }
code_tokens: public function filter ( callable $ callback = null ) { foreach ( $ this -> items as $ key => $ value ) { if ( ( ! $ callback && ! ( bool ) $ value ) || ( $ callback && ! $ callback ( $ value , $ key ) ) ) { unset ( $ this -> items [ $ key ] ) ; } } return $ this ; }
docstring: Filter elements from the list
  
  @param  callable|null $callback A function the receives ($value, $key) and must return a boolean to indicate
  filter status
  
  @return $this
docstring_tokens: Filter elements from the list