rfc:arrow_functions

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:arrow_functions [2017/01/31 17:27]
levim Fix link formatting
rfc:arrow_functions [2018/06/28 14:35] (current)
levim Withdraw
Line 4: Line 4:
   * Author: Levi Morrison <​levim@php.net>​   * Author: Levi Morrison <​levim@php.net>​
   * Author: Bob Weinand <​bwoebi@php.net>​   * Author: Bob Weinand <​bwoebi@php.net>​
-  * Status: ​Under Discussion+  * Status: ​Withdrawn
   * First Published at: http://​wiki.php.net/​rfc/​arrow_functions   * First Published at: http://​wiki.php.net/​rfc/​arrow_functions
  
Line 63: Line 63:
 ==== Type Declarations ==== ==== Type Declarations ====
 This RFC does support type declarations for parameters and return types. This issue was noted multiple times on the mailing list during the short closures RFC as something that bothered voters. Therefore this RFC permits them but the authors discourage their general use in arrow functions. This RFC does support type declarations for parameters and return types. This issue was noted multiple times on the mailing list during the short closures RFC as something that bothered voters. Therefore this RFC permits them but the authors discourage their general use in arrow functions.
 +
 +Here are some examples to show the syntax:
 +
 +<PHP>
 +fn (array $x) => $x
 +fn (): int => 42
 +</​PHP>​
  
 ==== References ==== ==== References ====
-Parameters and return values can be passed/​returned by reference. As mentioned elsewhere, implicitly bound variables will be bound //by value// and not //by reference//​.+Parameters and return values can be passed/​returned by reference. As mentioned elsewhere, implicitly bound variables will be bound //by value// and not //by reference//​. ​References go in the usual places: 
 + 
 +<​PHP>​ 
 +fn &(array &$xs) => $xs 
 +</​PHP>​
  
 ==== Static Arrow Functions ==== ==== Static Arrow Functions ====
rfc/arrow_functions.1485883647.txt.gz · Last modified: 2017/09/22 13:28 (external edit)