|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 20:01:28 2019 UTC