[php-src] PR #22025: GH-22000: ensure __isset is not returning a reference before calling it
| From: | zaaarf | Date: | Tue, 12 May 2026 13:30:50 +0000 |
| Subject: | [php-src] PR #22025: GH-22000: ensure __isset is not returning a reference before calling it | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36105@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22025
Author: zaaarf
#22000 outlines a problem that happens in the new-ish 8.6 methods introduced by [this
RFC](https://wiki.php.net/rfc/isreadable-iswriteable) (hence why I'm submitting this against
master).
They call __isset, but if the implementer made __isset return a reference,
the call breaks and fails an assertion. I am pretty sure this qualifies as an unrecoverable state,
so I just added a check before calling it that ensures that __isset does not return a
reference, throwing an exception if that's the case so at least the user gets a graceful exit.
If this is recoverable, please do leave me a comment on how you envision it, and I'll make it
happen.
Not sure if this "bug" warrants a dedicated test, but if it does, leave me a comment and
I'll add it.
I should add that this is kind of a dirty fix that addresses the situation in a single case; we
should probably look towards forbidding magic methods from returning references altogether, but
maybe there's some valid niche use case that I can't envision.