rfc:remove_hex_support_in_numeric_strings

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:remove_hex_support_in_numeric_strings [2015/01/03 19:39] – d ajfrfc:remove_hex_support_in_numeric_strings [2015/01/28 21:57] – Implemented nikic
Line 2: Line 2:
   * Date: 2014-08-19   * Date: 2014-08-19
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
-  * Status: Draft +  * Status: Implemented (in PHP 7)
-  * Target version: PHP 7+
  
 ===== Introduction ===== ===== Introduction =====
Line 11: Line 10:
 PHP internally has two primary methods from converting strings into numbers: PHP internally has two primary methods from converting strings into numbers:
  
-The first, and most commonly used, are direct casts to the integer or float types (''convert_to_long'' and ''convert_to_double''). These casts do **NOT** support hexadecimal decimals:+The first, and most commonly used, are direct casts to the integer or float types (''convert_to_long'' and ''convert_to_double''). These casts do **NOT** support hexadecimal numbers:
  
 <code php> <code php>
Line 39: Line 38:
 var_dump('0x123' == '291'); // TRUE var_dump('0x123' == '291'); // TRUE
  
-var_dump((int) '0x123' == (int) '291')); // FALSE+var_dump((int) '0x123' == (int) '291'); // FALSE
 </code> </code>
  
Line 66: Line 65:
  
 ===== Vote ===== ===== Vote =====
 +
 +As this is a language change a 2/3 majority is required.
 +
 +The vote started on 2015-01-17 and ends on 2015-01-27.
 +
 +<doodle title="Remove hex support in numeric strings?" auth="nikic" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
  
rfc/remove_hex_support_in_numeric_strings.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1