public function erase() { foreach ($this->rules as $handler) { $handler->cancel(); } foreach ($this->anchors as $anchor) { $anchor->cancel(); } $this->rules = []; $this->rulesPointer = 0; $this->anchors = []; $this->anchorsPointer = 0; }