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

From: Date: Wed, 12 Feb 2025 21:44:24 +0000
Subject: 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
I must agree with Kamil. I don't see practical benefits of this feature
that would surpass the implications it has for the language. We already
have static analysis handling such cases and it can be extended even to
non-pure functions. Moreover, syntax (void) adds additional complexity to
beginners' understanding of the typing system. The second option with $_ is
BC on the other hand, so both options are unsatisfying. And honestly, I
don't have good ideas for it.

Kind regards,
Jorg Sowa


Thread (48 messages)

« previous php.internals (#126384) next »