Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.13.0

Bug #6042 Handling xsd:long
Submitted: 2005-11-23 05:18 UTC Modified: 2007-01-19 20:26 UTC
From: simunek at vol dot cz Assigned: yunosh
Status: Closed Package: SOAP
PHP Version: 4.4.1 OS: FreeBSD
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-23 05:18 UTC] simunek at vol dot cz
Description: ------------ Per specifications, datatype xsd:long is a 64-bit integer. It's casted into integer PHP type in this PEAR class. PHP integer type is only 32-bit. That results in trimming the value down to MAXINT. Bad news is that PHP don't have 64-bit integer (long long) type. Possible solutions would be to cast the value into string. That works for me. Index: Base.php =================================================================== RCS file: /repository/pear/SOAP/Base.php,v retrieving revision 1.51 diff -a -u -r1.51 Base.php --- Base.php 8 Oct 2005 23:44:22 -0000 1.51 +++ Base.php 23 Nov 2005 09:58:33 -0000 @@ -301,7 +301,7 @@ 'integer' => 'integer', 'nonPositiveInteger' => 'integer', 'negativeInteger' => 'integer', - 'long' => 'integer', + 'long' => 'string', 'int' => 'integer', 'short' => 'integer', 'byte' => 'string', Test script: --------------- <item><invoice_number xsi:type="xsd:long">6105003037</invoice_number></item> Expected result: ---------------- 6105003037 Actual result: -------------- 2147483647

Comments

 [2007-01-19 20:26 UTC] yunosh (Jan Schneider)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.