rfc:switch-expression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rfc:switch-expression [2019/10/18 05:29] – created brzuchalrfc:switch-expression [2019/10/18 05:41] (current) brzuchal
Line 1: Line 1:
 ====== PHP RFC: Switch Expression ====== ====== PHP RFC: Switch Expression ======
   * Version: 1.0   * Version: 1.0
-  * Date: 2019-09-12+  * Date: 2019-10-18
   * Author: Michał Brzuchalski <brzuchal@php.net>   * Author: Michał Brzuchalski <brzuchal@php.net>
   * Status: Draft   * Status: Draft
Line 39: Line 39:
 </code> </code>
  
-==== Switch Expression Syntax ====+==== Syntax ====
  
 The proposal is to introduce a new form of switch label, written "case C =>" to signify that only  The proposal is to introduce a new form of switch label, written "case C =>" to signify that only 
Line 68: Line 68:
  
 $kind = "baz"; $kind = "baz";
-$foo = switch ($kind): string {+$foo = switch ($kind) {
   case "foo" => "matched 'foo'!";   case "foo" => "matched 'foo'!";
   case "bar" => "matched 'bar'";   case "bar" => "matched 'bar'";
rfc/switch-expression.1571376559.txt.gz · Last modified: 2019/10/18 05:29 by brzuchal