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
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC