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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zeta2ste2000 at yahoo dot it
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC