Uh oh!
There was an error while loading. Please reload this page.
Add (void) cast - #18115
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I guess you could optimize it a bit by not even handling IS_CONSTANT_AST in the first place, i.e. early returning.
I would still keep the IS_CONST handling below though because it generalises.
There was a problem hiding this comment.
As with the (void)(bool) cast, this feels like needless added complexity for a case that is unlikely to happen in practice and also no longer matters once the file is compiled and OPcached.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
iluuu1994
left a comment
There was a problem hiding this comment.
This is missing support for AST printing in zend_ast.c.
LGTM otherwise.
Uh oh!
There was an error while loading. Please reload this page.
RFC: https://wiki.php.net/rfc/marking_return_value_as_important
Spun out of #17599, since the
(void)cast implementation is fully independent of the#[\NoDiscard]implementation and sufficiently complex on its own, allowing for an easier review.