rfc:switch_expression

Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
rfc:switch_expression [2020/03/28 00:59] – created ilijatovilorfc:switch_expression [2020/03/28 10:52] – Minor rewording ilijatovilo
Line 2: Line 2:
   * Date: 2020-03-28   * Date: 2020-03-28
   * Author: Ilija Tovilo, ilija.tovilo@me.com   * Author: Ilija Tovilo, ilija.tovilo@me.com
 +  * Author: Michał Brzuchalski, brzuchal@php.net
   * Status: Draft   * Status: Draft
   * Target Version: PHP 8.0   * Target Version: PHP 8.0
   * Implementation: https://github.com/php/php-src/pull/5308   * Implementation: https://github.com/php/php-src/pull/5308
 +  * Previous RFC: https://wiki.php.net/rfc/switch-expression-and-statement-improvement
  
 ===== Introduction ===== ===== Introduction =====
Line 169: Line 171:
  
 <code php> <code php>
-$x = switch ($y) {}+$x = switch ($y) {};
 // instead of // instead of
-$x = $y switch {}+$x = $y switch {};
 </code> </code>
  
Line 187: Line 189:
  
 ===== "Why don't you just use x" ===== ===== "Why don't you just use x" =====
-The have been some comments on how you can already achieve the same result.+There have been some comments on how you can already achieve the same result.
  
 ==== if statements ==== ==== if statements ====
rfc/switch_expression.txt · Last modified: 2020/04/12 00:04 by ilijatovilo