php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45058 Integer Limit Problem
Submitted: 2008-05-21 14:47 UTC Modified: 2008-05-21 22:15 UTC
From: crbdigo at gmail dot com Assigned:
Status: Not a bug Package: *Programming Data Structures
PHP Version: 5.2CVS-2008-05-21 (CVS) OS: Windows Vista 64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: crbdigo at gmail dot com
New email:
PHP Version: OS:

 

 [2008-05-21 14:47 UTC] crbdigo at gmail dot com
Description:
------------
I'm using the PHP V5.2.0 on Windows Vista 64 Bits, I have a error when I try to convert a string "97722694578" to a integer, the value of variable is modified to 2147483647 (int limit of php).
I'd have this problem when I try to send the value to a Web Service (APS.NET/C#) with the SoapClass of PHP, how the parameter on WS is a "long" the PHP tried to convert to a integer, then the value is modified to 2147483647.
Soluction: Convert the variable to "float" on PHP before send's to WS. That works :D.

Thank you

Reproduce code:
---------------
$variable = "97722694578";
settype($variable, "float");
and send to WS.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-21 22:08 UTC] crrodriguez at suse dot de
This is the expected behaviuor.

http://php.net/manual/en/language.types.integer.php
 [2008-05-21 22:15 UTC] felipe@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC