rfc:number_format_separator

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
rfc:number_format_separator [2015/12/26 15:42] tpuntrfc:number_format_separator [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 3: Line 3:
   * Date: 2015-12-19   * Date: 2015-12-19
   * Author: Thomas Punt, tpunt@php.net   * Author: Thomas Punt, tpunt@php.net
-  * Status: Draft+  * Status: Declined
   * First Published at: http://wiki.php.net/rfc/number_format_separator   * First Published at: http://wiki.php.net/rfc/number_format_separator
  
Line 46: Line 46:
 </code> </code>
  
-==== Chosen semantics ====+The underscores will be stripped out during the lexing stage, and so the runtime will not be affected in any way. For example: 
 +<code php> 
 +var_dump(1_000_000); // int(1000000) 
 +</code> 
 + 
 +==== Chosen syntax ==== 
 + 
 +The digit separator is used to mark boundaries between digits - it is not used to separate digits from other characters. The following syntax choices are therefore based on this.
  
 === Disallow leading underscores === === Disallow leading underscores ===
Line 114: Line 121:
  
 ==== Why no support for stringy numerics? ==== ==== Why no support for stringy numerics? ====
-This RFC does not include stringy numerics because of the BC breakage involved. It would cause the coercion rules for strings to integers to change, which may potentially have wide-ranging impacts for PHP programs. If formatting stringy integer literals is desired, then support for these can be done in the next major version of PHP.+This RFC does not include stringy numerics because of the BC breakage involved. It would mean changing the coercion rules for strings to integers, which may potentially have wide-ranging impacts for PHP programs. Also, support for stringy numerics can be quite easily emulated in userland code. 
 + 
 +If formatting stringy numerical literals is desired, then support for these can be added in the next major version of PHP.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 144: Line 153:
 Support for stringy numerics could be added in the next major version. Support for stringy numerics could be added in the next major version.
  
-===== Proposed Voting Choices ===== +===== Vote ===== 
-A simple yes/no voting option with a 2/3 majority required.+A simple yes/no voting option on whether to support digit separator in PHP. A 2/3 majority is required
 + 
 +<doodle title="Include a Digit Separator into PHP" auth="tpunt" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle> 
 + 
 +Voting starts on January 13th and ends on January 20th.
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-A patch has been made - this part will be updated soon.+PR: https://github.com/php/php-src/pull/1699
  
 ===== Implementation ===== ===== Implementation =====
Line 157: Line 173:
  
 ===== References ===== ===== References =====
-Current discussion: to be updated...+Current discussion: https://marc.info/?l=php-internals&m=145149644624888&w=2
  
 Previous discussion on separators for numerical literals: https://marc.info/?l=php-internals&m=142431171323037&w=2 Previous discussion on separators for numerical literals: https://marc.info/?l=php-internals&m=142431171323037&w=2
rfc/number_format_separator.1451144550.txt.gz · Last modified: 2017/09/22 13:28 (external edit)