Re: #[Deprecated] Attribute

From: Date: Wed, 13 Jan 2021 14:02:10 +0000
Subject: Re: #[Deprecated] Attribute
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-112871@lists.php.net to get a copy of this message
On 13/01/2021 12:51, Marco Pivetta wrote:
For me, runtime behavior is: [...] * a production outage risk
If your production code can cause outages based on E_DEPRECATED notices, then that's a bug in your code. I can't think of any justification for a production system to abort because of a notification about future changes. If we have to consider every introduction of a deprecation notice as a breaking change, then we're stuck in a Catch-22, because the whole point of such notices is to warn of upcoming breaking changes.
As usual, I'm fighting for pushing things into compile-time rather than runtime
In principle, I do agree with this, but as Benjamin says, it's quite a meaty topic in its own right. It's also unlikely to ever eliminate 100% of runtime checks, because you can't statically analyse completely dynamic code. Defining #[Deprecated] as "do what all the other deprecations do", and later changing that *for all existing deprecations* seems reasonable. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#112871) next »