Re: Strict switch

From: Date: Tue, 01 Dec 2020 20:39:51 +0000
Subject: Re: Strict switch
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-112362@lists.php.net to get a copy of this message
Hi!
I'm referring to support for non-trivial expressions, aka blocks. Say, the ability to split up a long expression by using a meaningful temporary variable. Block support is sufficient to cover *most* switch use-cases, obviating the need to introduce a new switch variant.
We could take a page from Scala book and designate a return value to a block (of course, no reason to bother if it's not used) - which should make it relatively easy to add blocks in any expression context. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#112362) next »