|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72839 is_numeric returns false for hex strings
Submitted: 2016-08-15 08:32 UTC Modified: 2016-08-15 10:58 UTC
From: Alexander dot Blum at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 7.1Git-2016-08-15 (Git) OS: Ubuntu 16.04
Private report: No CVE-ID: None
 [2016-08-15 08:32 UTC] Alexander dot Blum at gmail dot com
With PHP7 is_numeric reports false when passing hexadecimal strings, it worked fine in PHP5

Test script:
var_dump (is_numeric ("0x111"))

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-15 08:46 UTC]
-Status: Open +Status: Not a bug
 [2016-08-15 09:08 UTC] Alexander dot Blum at gmail dot com
Well, then the documentation needs a bugfix:
 [2016-08-15 10:42 UTC]
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.
 [2016-08-15 10:58 UTC] occurs to me that all these new bugs will be about removing text, so even a non-speaker could fix them all. Oh well.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 05:01:30 2024 UTC