We have a customer that is trying to call our web service written in C# from PHP code. The web service call takes a long as parameter.
This call works fine for other customers calling from C# or Java but this customer is getting an error back from the call. I haven’t debugged their specific call but I am guessing that the 64bit integer is getting truncated somehow from PHP. The customer says they are just making the web service call with a string but is there a wrapper in PHP that does type conversion. Could this be losing the number information?
Thanks for any info.
Most PHP installations won’t support 64 bit integers – 32 is the max. You can check this by reading the PHP_INT_SIZE constant (4 = 32bit, 8 = 64bit) or read the PHP_INT_MAX value.
If the web service class he is using is trying to type-convert a string representation of a 64 bit integer, then yes, it’s mostly likely being truncated or converted into a float. You can sort of see this behavior with this simple test
Without knowing the details of his implementation, it’s difficult to postulate on what a good solution/workaround might be.