Implement SeekableIterator for SplObjectStorage

php.internals

Niels Dossche

2 years ago
Hi internals I opened a PR to make SplObjectStorage implement SeekableIterator, this means that it'll now be possible to use `seek(int $offset): void` on SplObjectStorage. I'm mainly posting here to see if there are any objections. PR link: https://github.com/php/php-src/pull/13665 Kind regards Niels

Weirdan

2 years ago
On Sun, Mar 10, 2024 at 9:14 PM Niels Dossche <dossche.niels@gmail.com> wrote:
> I opened a PR to make SplObjectStorage implement SeekableIterator, this means that it'll now be possible to use `seek(int $offset): void` on SplObjectStorage
Note that it's a BC break for descendants of SplObjectStorage with an incompatible `seek()` already implemented (e.g. https://3v4l.org/uW9Yl), so it shouldn't happen in a patch release. Not that I expect there to be many of those, but still.
-- Best regards, Bruce Weirdan mailto:weirdan@gmail.com

Niels Dossche

2 years ago
Hi Bruce On 10/03/2024 21:43, Bruce Weirdan wrote:
> On Sun, Mar 10, 2024 at 9:14 PM Niels Dossche <dossche.niels@gmail.com> wrote: > >> I opened a PR to make SplObjectStorage implement SeekableIterator, this means that it'll now be possible to use `seek(int $offset): void` on SplObjectStorage > > Note that it's a BC break for descendants of SplObjectStorage with an > incompatible `seek()` already implemented (e.g. > https://3v4l.org/uW9Yl), so it shouldn't happen in a patch release.
Indeed, that's why the PR is targeted to the master branch, i.e. PHP 8.4 :)
> Not that I expect there to be many of those, but still. > > > > -- > Best regards, > Bruce Weirdan mailto:weirdan@gmail.com
Kind regards Niels