Re: Re: RFC: Marking return values as important (#[\NoDiscard])

From: Date: Mon, 03 Mar 2025 16:14:25 +0000
Subject: Re: Re: RFC: Marking return values as important (#[\NoDiscard])
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi,Am 03.03.2025 15:30 schrieb Volker Dusch <[email protected]>:On Wed, Jan 29, 2025 at
4:12 PM Tim Düsterhus <[email protected]> wrote:Volker and I would like to start discussion
on our RFC to allow "Markingreturn values as important (#[\NoDiscard])".Please find the
following resources for your reference:- RFC: https://wiki.php.net/rfc/marking_return_value_as_important-
Implementation: https://github.com/php/php-src/pull/17599Hi,Thank
you to everyone who responded to our call for comments on the list here, and to Ondřej who replied
on Mastodon to the question if the property would be useful for Static Analysis tools: https://phpc.social/@OndrejMirtes/114040888791921128

Given that the thread has died down, and all points have been discussed, we plan to start the voting
later this week unless any important point comes up.

We have also updated the RFC to note that, if (void) is not voted for in the secondary vote,
we'd special case $_ as a discard outlet such that OPcache will not optimize the
unused variable.In this thread, I only found the information that currently OPcache does not discard
such unused assignments. It would be good to know if such optimization could be considered to not
end up in a situation that such optimization would be useful but can't be applied as of this
feature.

Kind Regards,Volker


Regards,Marc


Thread (48 messages)

« previous php.internals (#126555) next »