Hi Tim,

On Tue, Mar 4, 2025, 22:16 Tim Düsterhus <t...@bastelstu.be> wrote:

> Hi Marc
>
> Should the `(void)` cast not be accepted, we will only special case the
> assignment to `$_` to not be elided, even if OPcache knows that the
> function will never return an object. The behavior for other variables
> will remain unchanged.

X


Just asking, as my engine knowledge is a bit limited,
Wouldn't it be possible that when OPcache would optimize away the unused
variable assigned to a function, it could detect that that function have
the NoDiscard attribute and also remove the attribute effect (warning
triggering).
Or identify that the function has the NoDiscard attribute and based on that
do not optimize away the variable?

--
Alex

Reply via email to