Description
Originally reported by @flex0geek.
The following code:
<?phpclass FreeSelfOnRewind implements Iterator {
publicfunction__construct(privateMultipleIterator$parent) {}
publicfunctionrewind(): void {
$this->parent->detachIterator($this);
var_dump($this);
}
publicfunctioncurrent(): mixed { return0; }
publicfunctionkey(): mixed { return0; }
publicfunctionnext(): void {}
publicfunctionvalid(): bool { returnfalse; }
}
$mi = newMultipleIterator();
$mi->attachIterator(newFreeSelfOnRewind($mi));
$mi->rewind();Resulted in this output:
The same goes for various other MultipleIterator methods that call methods on the child iterator without addref.
PHP Version
Operating System
No response
Description
Originally reported by @flex0geek.
The following code:
Resulted in this output:
The same goes for various other
MultipleIteratormethods that call methods on the child iterator without addref.PHP Version
Operating System
No response