rfc:arrayof

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:arrayof [2014/01/17 11:43] krakjoerfc:arrayof [2014/02/27 21:00] philstu
Line 1: Line 1:
  
 ====== PHP RFC: Array Of ====== ====== PHP RFC: Array Of ======
-  * Version: 0.1.1+  * Version: 0.1.2
   * Date: 2014-01-15   * Date: 2014-01-15
   * Author: Joe Watkins, krakjoe@php.net & Phil Sturgeon philstu@php.net   * Author: Joe Watkins, krakjoe@php.net & Phil Sturgeon philstu@php.net
Line 148: Line 148:
 Logic here would dictate that if you ask for a bag of spanners, you get a bag of spanners, not a bag with a few spanners and maybe a few  "I owe you one spanner" notes. Logic here would dictate that if you ask for a bag of spanners, you get a bag of spanners, not a bag with a few spanners and maybe a few  "I owe you one spanner" notes.
  
-2. Should multi-dimensional hints be allowed?+===== Closed Questions ===== 
 + 
 +1. Should multi-dimensional hints be allowed?
  
 <code php> <code php>
Line 154: Line 156:
 </code> </code>
  
-This suggests that array(array(new Foo)) is an acceptable valueI am not sure how useful that isas you should probably calm down on your nested array structure little bit and maybe require an objector split it into multiple parameters.+The general consensus seemed to be that instead of using "function (ChessPieces[][])" a better solution would probably to simply use "function (Black[] $pieces, White[] $pieces)" instead. 
 + 
 + 
 +2. RFC suggested syntaxor Hack Generics syntax? 
 + 
 +With this features close proximity to the "generics" feature found in other languages - including Java, C# and Hack - the Hack syntax was suggested to replace the syntax in this RFC, which would be the first half of larger effort in a later version to introduce full-generics. A survey was held to see if people were interested in going down the route of generics and the answer was mostly "Yesbut we want this Array Of too"
 + 
 +http://grokbase.com/p/php/php-internals/141rva4cf7/php-dev-vote-array-of-v-generics 
 + 
 +Java has both features, with their own syntax. This means there is no reason for us to hold off implementing with the existing syntax and looking into adding generics as well, at a later date.  
 + 
 +If people want to change the syntax of this feature more in line with Hack generics syntax then simply vote no, and we can revisit the issue.
  
-One example provided has been "function (ChessPieces[][])". This would probably be better off as "function (Black[] $pieces, White[] $pieces)". 
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/arrayof.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1