Re: [RFC] Increment/Decrement Fixes
| From: | Rowan Tommins | Date: | Mon, 02 Mar 2020 14:08:24 +0000 |
| Subject: | Re: [RFC] Increment/Decrement Fixes | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108803@lists.php.net to get a copy of this message | ||
Hi Alexandru,
On 2 March 2020 09:22:57 GMT+00:00, "Alexandru Pătrănescu"
<drealecs@gmail.com> wrote:
>For point 1 and 2, both the old and new behavior is silent. Can we
>think of
>a safer way to migrate?
That's a very good question, and one I don't have a particularly good answer to.
The problem with this kind of behaviour change is that there's no way
for PHP to know whether a particular piece of code has been changed to
expect the new behaviour or not, and therefore whether to raise a
deprecation notice. An opt-in notice on *all* usages could allow the
user to build up a list of places in their code to check, but they'd
still need to manually track which they'd already looked at, so I'm
not sure how useful it would be.
What I will look into is how well static analysis tools such as
PHPStan and Psalm could build a similar list, as I think that's
generally a more useful approach.
Regards,
--
Rowan Tommins
[IMSoP]