public function step($result, $input) { if ($this->n > 0) { $result = $this->xf->step($result, $input); } else { $result = Transducers::ensureReduced($result); } $this->n -= 1; return $result; }