Bug #72839 [Com]: is_numeric returns false for hex strings
| From: | Alexander dot Blum at gmail dot com | Date: | Mon, 15 Aug 2016 09:08:10 +0000 |
| Subject: | Bug #72839 [Com]: is_numeric returns false for hex strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203291@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
Comment by: Alexander dot Blum at gmail dot com
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:
Well, then the documentation needs a bugfix: https://secure.php.net/manual/de/function.is-numeric.php
Previous Comments:
------------------------------------------------------------------------
[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