rfc:number_format_separator
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:number_format_separator [2015/12/26 15:42] – tpunt | rfc:number_format_separator [2016/01/20 20:37] – tpunt | ||
---|---|---|---|
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: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 46: | Line 46: | ||
</ | </ | ||
- | ==== Chosen | + | 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); | ||
+ | </ | ||
+ | |||
+ | ==== Chosen | ||
+ | |||
+ | 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 | + | This RFC does not include stringy numerics because of the BC breakage involved. It would mean changing |
+ | |||
+ | If formatting stringy | ||
===== 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 | + | A simple yes/no voting option |
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | 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:// |
===== Implementation ===== | ===== Implementation ===== | ||
Line 157: | Line 173: | ||
===== References ===== | ===== References ===== | ||
- | Current discussion: | + | Current discussion: |
Previous discussion on separators for numerical literals: https:// | Previous discussion on separators for numerical literals: https:// |
rfc/number_format_separator.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1