php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Alexander dot Blum at gmail dot com
New email:
PHP Version: OS:

 

 [2016-08-15 08:32 UTC] 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)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-15 08:46 UTC] requinix@php.net
-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: https://secure.php.net/manual/de/function.is-numeric.php
 [2016-08-15 10:42 UTC] requinix@php.net
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] requinix@php.net
...it 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: Sat Nov 23 01:01:33 2024 UTC