rfc:reserve_more_types_in_php_7

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:reserve_more_types_in_php_7 [2015/02/19 00:31] – Mention union types levimrfc:reserve_more_types_in_php_7 [2015/04/01 09:59] nikic
Line 1: Line 1:
 ====== PHP RFC: Reserve More Types in PHP 7 ====== ====== PHP RFC: Reserve More Types in PHP 7 ======
-  * Version: 1.0+  * Version: 1.1
   * Date: 2015-02-18   * Date: 2015-02-18
   * Author: Levi Morrison <levim@php.net>   * Author: Levi Morrison <levim@php.net>
-  * Status: Draft+  * Status: Implemented (in PHP 7.0)
   * First Published at: http://wiki.php.net/rfc/reserve_more_types_in_php_7   * First Published at: http://wiki.php.net/rfc/reserve_more_types_in_php_7
  
Line 9: Line 9:
 This RFC prevents the use of the following words to be used as a class, interface or trait name: This RFC prevents the use of the following words to be used as a class, interface or trait name:
  
-  * ''int'', ''integer'' +  * ''int'' 
-  * ''bool'', ''boolean'' +  * ''float'' 
-  * ''true'', ''false'' +  * ''bool''
-  * ''float'', ''double''+
   * ''string''   * ''string''
 +  * ''true'', ''false''
   * ''null''   * ''null''
  
-This RFC does not fully reserve them as keywords; it only prohibits their usage as class, interface and trait names.+This RFC does not fully reserve them as keywords; it only prohibits their usage as class, interface and trait names. It also prevents them from being used in namespaces. 
 + 
 +I have chosen to not reserve ''integer'', ''double'' and ''boolean'' out of interest of proposing the smallest useful subset. Another RFC could reserve these aliases in the future.
  
 ===== Rationale ===== ===== Rationale =====
Line 35: Line 37:
 Potentially future RFCs could: Potentially future RFCs could:
  
 +  * reserve the aliases of these types, such as ''integer'', ''double'' and ''boolean''
   * add explicit scalar type support for parameter and return types   * add explicit scalar type support for parameter and return types
   * add union types, such as ''int|false''   * add union types, such as ''int|false''
Line 43: Line 46:
  
 This RFC requires at least two thirds of the votes to be "yes" to pass. This RFC requires at least two thirds of the votes to be "yes" to pass.
 +
 +<doodle title="reserve_more_types_in_php_7" auth="levim" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
 There is currently no implementation. There is currently no implementation.
  
 +
 +===== Version History =====
 +
 +  * 1.0: Reserve ''int'', ''integer'', ''float'', ''double'', ''bool'', ''boolean'', ''string'', ''true'', ''false'', ''null''
 +  * 1.1: No longer reserve ''integer'', ''double'' and ''boolean''
rfc/reserve_more_types_in_php_7.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1