Re: Return expression

From: Date: Mon, 02 Feb 2026 16:00:26 +0000
Subject: Re: Return expression
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-129979@lists.php.net to get a copy of this message
Hi Morgan On Mon, Feb 2, 2026 at 12:42 AM Morgan <weedpacket@varteg.nz> wrote: > > > So, for example: > > > $result = query('foo') ?? return false; > > rather than > > if(($result = query('foo')) === null) return false; Just a heads-up. This has been suggested before and leads to non-trivial issues with regards to mid-expression live-variable cleanup. I encountered similar issues for block expressions, for which { return; } is effectively equivalent to return. I explained the problem in more detail here: https://wiki.php.net/rfc/match_blocks#technical_implications_of_control_statements Ilija

« previous php.internals (#129979) next »