|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40020 int values with leading zeroes
Submitted: 2007-01-04 13:20 UTC Modified: 2007-01-04 13:24 UTC
From: pav at oook dot cz Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.0 OS: FreeBSD
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.
Block user comment
Status: Assign to:
Bug Type:
From: pav at oook dot cz
New email:
PHP Version: OS:


 [2007-01-04 13:20 UTC] pav at oook dot cz
I'm not totally convinced this is a valid SOAP, but anyway. I'm getting this from a SOAP::Lite server:

<inventory_number xsi:type="xsd:int">0022300455</inventory_number>

The value in PHP comes up as 4817197. The problem is that to_zval_long() calls strtol() with base 'zero', and libc function strtol() understands 0x* as hex (base 16) and 00* as octal (base 8) number, if base is unspecified (zero).

The fix here would be to change strtol() call to use base 10. Unless octal and hex representation of int is allowed in this datatype by specs.

I might also go to see why SOAP::Lite is tagging this as xsd:int instead of xsd:string.

What do you think about this, dmitry?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-04 13:22 UTC]
This is how PHP works for ages:
# php -r 'echo 0022300455;'
 [2007-01-04 13:24 UTC] pav at oook dot cz
Well, d'oh, yes, but this should be about what 0022300455 is supposed to mean in SOAP, not in PHP...
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 22:05:54 2022 UTC