Bug #12243 Updated: Large numbers not behaving as doubles
| From: | php-bugs at lists dot php dot net | Date: | Sat, 06 Jul 2002 05:00:08 +0000 |
| Subject: | Bug #12243 Updated: Large numbers not behaving as doubles | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13281@lists.php.net to get a copy of this message | ||
ID: 12243
Updated by: php-bugs@lists.php.net
Reported By: matysekj@usms.org
-Status: Feedback
+Status: No Feedback
Bug Type: Variables related
Operating System: FreeBSD 4.1.1-STABLE
PHP Version: 4.0.6
New Comment:
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2002-06-02 14:08:38] derick@php.net
Please try with the latest PHP version.
Derick
------------------------------------------------------------------------
[2001-08-08 19:02:22] jeroen@php.net
So you say that
var_dump(5000000000) -> int(2147483647)
And not, as expected:
float(5000000000)
PHP uses some system routines for that, this isn't coded in PHP.
Zend/zend_language_scanner.l:line_1000:
(...)
errno = 0;
/*long*/ lval = strtol(the_digit_as_a_string, NULL, 0);
if (errno == ERANGE) { /* overflow */
(...)
If strtol is doing his job right, there is no bug here...
Are you sure this didn't happen with the older PHP-version, on the same
box? Or is it just another pentium-bug (j/k)
It would help if you try to execute these lines in C, and see wether
ERANGE is set correctly. If it is, I'm lost.
By the way, please try also some other values than 5 billion, some
really huge values, and also some really negative values. Please use
var_dump on them.
------------------------------------------------------------------------
[2001-07-19 01:59:05] cynic@php.net
at your service
------------------------------------------------------------------------
[2001-07-19 00:23:14] matysekj@usms.org
Absolutely. I've written just one test script with just those 2 lines
in it. I copied this same file to 3 servers now - the 2 that I've
already mentioned plus another FreeBSD server (identical in hardware
and OS config to the other) running 4.03PL1. The only one of these
servers that prints out 2147483647 is the FreeBSD server running 4.06
(also did it with 4.05). The other 2 servers print out 5000000000. I
also remember another location in my site that was affected by this
bug, and I can GUARANTEE that it did not occur on the affected server
until I updated it to 4.05. Please change the status of this bug report
back to open.
------------------------------------------------------------------------
[2001-07-19 00:15:34] cynic@php.net
are you sure you don't initialize the variable with 5 Million on the
Linux box?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/12243
--
Edit this bug report at http://bugs.php.net/?id=12243&edit=1