php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41344 Error returning long values in the headers
Submitted: 2007-05-10 07:07 UTC Modified: 2007-05-10 20:04 UTC
From: zeta2ste2000 at yahoo dot it Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.2 OS: HP-UX 11.11
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
11 + 7 = ?
Subscribe to this entry?

 
 [2007-05-10 07:07 UTC] zeta2ste2000 at yahoo dot it
Description:
------------
When I have to manage a long number in the header, the __soapCall function returns a float number in exponential format. The original sent value can't be retrieved and the returned one is different.

Reproduce code:
---------------
A Java server sends a sessionID in the header with the following value : 339051398236687110
This is the client code :

    $soapclient->__soapCall('beginSession',$parameters, null, null, $header);
    echo $header["sessionID"]; // returns 3.3905139823669E+17 , an  
                               // invalid value for the next call
                               // and with less digits than required
    $strNum = number_format($header["sessionID"], 0, "", "");
    echo $strNum;              // returns the rounded value
                               // 339051398236687050 , that is 
                               // different from the original
                               // 339051398236687110

 

Expected result:
----------------
The header has to contain 339051398236687110

Actual result:
--------------
The header contain 3.3905139823669E+17

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-10 20:04 UTC] tony2001@php.net
Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 11:01:36 2019 UTC