Hi Iván > Would be posible for blocks to require a return statement instead of raising > an error?
It would be possible for the blocks to return values (though not with the return keyword). I've created a small prototype a few weeks ago: ``` $result = match ($x) { 0 => { echo 'Foo'; echo 'Bar'; 'Baz' }, ... }; ``` https://github.com/php/php-src/compare/master...iluuu1994:block-expression Heavily inspired by Rust: https://doc.rust-lang.org/reference/expressions/block-expr.html While this would perfectly solve the problem perfectly it feels a little foreign in PHP. Either way, this is something that can be discussed an implemented in a separate RFC. > Would be feasible for the fallthrought problem to use “continue” when you > really want to chain “cases”? Yes, that would be feasible. I personally just don't see a huge benefit of fallthrough. If we ever implemented pattern matching it could become unfeasible again (or at least require additional sanity checks): ``` match ($value) { Foo { foo: $foo } => { fallthrough; } Bar { bar: $bar } => { // $bar is unbound } } ``` Ilija -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php