Bug #48717 [Com]: Cannot pass datatype long (> 2147483647) in SOAP requests
| From: | perske at uni-muenster dot de | Date: | Fri, 28 Oct 2016 11:54:24 +0000 |
| Subject: | Bug #48717 [Com]: Cannot pass datatype long (> 2147483647) in SOAP requests | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205052@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=48717&edit=1
ID: 48717
Comment by: perske at uni-muenster dot de
Reported by: rob at zcore dot org
Summary: Cannot pass datatype long (> 2147483647) in SOAP
requests
Status: Open
Type: Bug
Package: SOAP related
Operating System: Debian GNU/Linux
PHP Version: 5.2.11
Block user comment: N
Private report: N
New Comment:
Even if you pass a huge integer as a string it is mixed up.
Reason: PHP 5.6.23, file ext/soap/php_encoding.c, function to_xml_long:
Line 1118:
if (Z_TYPE(tmp) != IS_LONG) {
convert_to_long(&tmp);
}
convert_to_string(&tmp);
If a string is passed, it should not be converted to long and back to string loosing precision with
very long integers.
Previous Comments:
------------------------------------------------------------------------
[2015-07-21 19:47:50] cmb@php.net
Related To: Bug #47624
------------------------------------------------------------------------
[2014-05-30 11:17:05] dev dot rindeal+bugs dot php dot net at outlook dot com
PHP 5.5.12 x86 on Windows 8 and it's still there. Thankfully the workaround in the comment #1
works for me. Thank you "ghostbaer at gmx dot de", you saved my work.
------------------------------------------------------------------------
[2010-10-27 20:46:44] pajoye@php.net
try:
$a = "1234";
$b = 1234;
if ($a == $b) echo "hopla";
well known problem related to php auto casting, or better said, typeless.
------------------------------------------------------------------------
[2010-10-27 20:20:24] periklis dot tsirakidis at mayflower dot de
Ouch... Pierre,
one serious notice is, that we changed the wsdl for <options> from xsd:long to xsd:string and
the problem is still there. Do we have here an auto-casting from string to long?
Any ideas?
------------------------------------------------------------------------
[2010-10-27 20:15:57] pajoye@php.net
PHP on windows uses 32bit integer for long, always. That's not possible to fix easily either.
Two choices, either convert to double when an integer overflow happens, or wait until we have big
integer support.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=48717
--
Edit this bug report at https://bugs.php.net/bug.php?id=48717&edit=1