Reputation: 147
Hello i have tried to use a Webservice
method that takes a parameter as a big integer
which has +25 digits
, however, when i use var_dump
function, show the parameter as a float
:
array (size=3)
'recIds' =>
array (size=1)
0 => float 5.66069912127E+18
'username' => string 'username' (length=9)
'password' => string 'password' (length=4)
Here is my .Php
<?php
ini_set("soap.wsdl_cache_enabled", "0");
$sms_client = new SoapClient('http://87.107.121.54/post/send.asmx?wsdl', array('encoding'=>'UTF-8'));
$parameters['recIds'] = array(5660699121269961781); //for Example
$parameters['username'] = "username";
$parameters['password'] = "password";
var_dump($parameters);
?>
I really need the parameter to be passed as integer
Upvotes: 1
Views: 114
Reputation: 147
Credit Goes to @MarkBaker
Assuming you're working with a 32-bit version of PHP, then yes, this will happen.... switch to a 64-bit version of PHP, which supports an integer range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, or from −(2^63) to 2^63 − 1
Upvotes: 1