original_string: public function filter(callable $func) : self
      {
          $list = $this->list;
          $acc = [];
  
          foreach ($list as $index => $val) {
              if ($func($val)) {
                  $acc[] = $val;
              }
          }
  
          return new static(\SplFixedArray::fromArray($acc));
      }
code: public function filter(callable $func) : self
      {
          $list = $this->list;
          $acc = [];
  
          foreach ($list as $index => $val) {
              if ($func($val)) {
                  $acc[] = $val;
              }
          }
  
          return new static(\SplFixedArray::fromArray($acc));
      }
code_tokens: public function filter ( callable $ func ) : self { $ list = $ this -> list ; $ acc = [ ] ; foreach ( $ list as $ index => $ val ) { if ( $ func ( $ val ) ) { $ acc [ ] = $ val ; } } return new static ( \ SplFixedArray :: fromArray ( $ acc ) ) ; }
docstring: filter method.
  
  @method filter
  
  @param callable $func
  
  @return object Collection
docstring_tokens: filter method .