Re: [DISCUSSION] Match expression

From: Date: Mon, 20 Apr 2020 18:19:44 +0000
Subject: Re: [DISCUSSION] Match expression
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-109728@lists.php.net to get a copy of this message
Hi internals Just a heads up, I'd like to start the voting on the match expression RFC in a couple of days. https://wiki.php.net/rfc/match_expression I have made a number of changes to the RFC. * Block return values are now allowed but limited to match arms (https://wiki.php.net/rfc/match_expression#blocks) * Nikita and I have discussed this here: https://github.com/php/php-src/pull/5407 * continue targeting match is no longer allowed (compilation error) (https://wiki.php.net/rfc/match_expression#breakcontinue) * Minor rewording The jury is still out on: * Optional semicolon when using match as a statement (https://wiki.php.net/rfc/match_expression#semicolon) * It makes the grammar somewhat complicated * Nesting match expression blocks without parentheses aren't possible (https://github.com/php/php-src/pull/5407#issuecomment-616612763) * Compilation error when not returning a value from a block (https://wiki.php.net/rfc/match_expression#blocks) * When the block terminates (e.g. through throw or exit) no return value is needed but the current implementation requires it * We could make this a runtime error instead If you have anything new to add to the discussion, this is your chance! Ilija

« previous php.internals (#109728) next »