Bug #72839 [Nab]: is_numeric returns false for hex strings
| From: | requinix@php.net | Date: | Mon, 15 Aug 2016 10:42:15 +0000 |
| Subject: | Bug #72839 [Nab]: is_numeric returns false for hex strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203292@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72839&edit=1
ID: 72839
Updated by: requinix@php.net
Reported by: Alexander dot Blum at gmail dot com
Summary: is_numeric returns false for hex strings
Status: Not a bug
Type: Bug
Package: Unknown/Other Function
Operating System: Ubuntu 16.04
PHP Version: 7.1Git-2016-08-15 (Git)
Block user comment: N
Private report: N
New Comment:
Translations affected: pt_BR, DE, KR, RU, ES, TR
FR, JA, RO are already fixed. ZH is not affected because it only says "if var is numeric then
true otherwise false".
Since this affects multiple translations I'm going to make multiple bug reports for them.
Previous Comments:
------------------------------------------------------------------------
[2016-08-15 09:08:10] Alexander dot Blum at gmail dot com
Well, then the documentation needs a bugfix: https://secure.php.net/manual/de/function.is-numeric.php
------------------------------------------------------------------------
[2016-08-15 08:46:58] requinix@php.net
That's right.
http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.strings.hex
https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings
------------------------------------------------------------------------
[2016-08-15 08:32:54] Alexander dot Blum at gmail dot com
Description:
------------
With PHP7 is_numeric reports false when passing hexadecimal strings, it worked fine in PHP5
Test script:
---------------
var_dump (is_numeric ("0x111"))
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72839&edit=1