php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53308 base_convert having issues with leading zeros
Submitted: 2010-11-14 07:36 UTC Modified: 2010-11-14 07:43 UTC
From: phoenix at ailesdefeu dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.3SVN-2010-11-14 (SVN) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phoenix at ailesdefeu dot com
New email:
PHP Version: OS:

 

 [2010-11-14 07:36 UTC] phoenix at ailesdefeu dot com
Description:
------------
base_convert having issues with leading zeros

Test script:
---------------
echo base_convert(82000,10,16);
echo base_convert(082000,10,16);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-14 07:37 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2010-11-14 07:37 UTC] rasmus@php.net
What do you mean?  Numbers with leading 0's are octal, so 082000 is not a valid 
number.
 [2010-11-14 07:43 UTC] phoenix at ailesdefeu dot com
If that's intended please disregard.

Just struck me it calculates '082000' and 82000  to the same value but not 082000.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Apr 08 16:01:25 2020 UTC