public function filter(callable $cb) { $count = count($this->sfa); $sfa = new SplFixedArray($count); $newCount = 0; foreach ($this->sfa as $el) { if ($cb($el)) { $sfa[$newCount++] = $el; } } $sfa->setSize($newCount); return new static($sfa); }