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/28 19:14] 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 44: Line 44:
 0267_3432; // versus 02673432 0267_3432; // versus 02673432
 1_123.456_7e2 // versus 1123.4567e2 1_123.456_7e2 // versus 1123.4567e2
 +</code>
 +
 +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> </code>
  
Line 116: 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 146: 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 =====
Line 159: 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.1451330092.txt.gz · Last modified: 2017/09/22 13:28 (external edit)