[PHP-DEV] Bug #12243 Updated: Large numbers not behaving as doubles
ID: 12243 Updated by: jeroen Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Variables related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.6 New Comment: So you say that var_dump(50) - int(2147483647) And not, as expected: float(50) 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. Previous Comments: [2001-07-19 01:59:05] [EMAIL PROTECTED] at your service [2001-07-19 00:23:14] [EMAIL PROTECTED] 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 50. 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] [EMAIL PROTECTED] are you sure you don't initialize the variable with 5 Million on the Linux box? [2001-07-19 00:03:32] [EMAIL PROTECTED] If this is strictly hardware related, then how come when I run the exact same 2 lines on another box running linux, I get the correct 5 billion number displayed? The linux box is using an AMD 450 Mhz K6, and the FreeBSD box is using a Pentium 3-600. I am not able to back up to 4.03PL1 on the FreeBSD box, but I am quite sure that this problem did not occur back when it was loaded. [2001-07-18 23:52:41] [EMAIL PROTECTED] 1) longlong != double 2) the scale is HW-dependant, i. e. you need a 64-bit HW to get native support for 64-bit numbers. that's how it's always been in PHP. there was no change WIRT this. 5,000,000,000 is clearly more than your HW can take, so it's clipped to the closest possible value. 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/?id=12243 Edit this bug report at http://bugs.php.net/?id=12243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12243 Updated: Large numbers not behaving as doubles
ID: 12243 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Variables related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.6 New Comment: I've verified that this behavior is relatively new. It does not happen in 4.03PL1, but does in 4.05 and 4.06. Previous Comments: [2001-07-18 23:13:02] [EMAIL PROTECTED] $testnumber = 50; echo $testnumber; The result is 2147483647. The variable is of type integer, even though it was initialized with a double value. I first noticed this with PHP 4.05 and it still occurs with 4.05. I do not believe it behaved this way back when I had 4.03PL1 installed. My configure line is: './configure' '--with-gd=no' '--with-mysql=/usr/local' '--with-config-file-path=/usr/home/priraise/phpini' '--enable-debug=no' '--enable-track-vars=yes' '--enable-ftp=yes' '--enable-force-cgi-redirect=yes' '--with-openssl' '--enable-trans-sid' '--enable-xml' Edit this bug report at http://bugs.php.net/?id=12243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12243 Updated: Large numbers not behaving as doubles
ID: 12243 Updated by: cynic Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: Variables related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.6 New Comment: 1) longlong != double 2) the scale is HW-dependant, i. e. you need a 64-bit HW to get native support for 64-bit numbers. that's how it's always been in PHP. there was no change WIRT this. 5,000,000,000 is clearly more than your HW can take, so it's clipped to the closest possible value. Previous Comments: [2001-07-18 23:34:07] [EMAIL PROTECTED] I've verified that this behavior is relatively new. It does not happen in 4.03PL1, but does in 4.05 and 4.06. [2001-07-18 23:13:02] [EMAIL PROTECTED] $testnumber = 50; echo $testnumber; The result is 2147483647. The variable is of type integer, even though it was initialized with a double value. I first noticed this with PHP 4.05 and it still occurs with 4.05. I do not believe it behaved this way back when I had 4.03PL1 installed. My configure line is: './configure' '--with-gd=no' '--with-mysql=/usr/local' '--with-config-file-path=/usr/home/priraise/phpini' '--enable-debug=no' '--enable-track-vars=yes' '--enable-ftp=yes' '--enable-force-cgi-redirect=yes' '--with-openssl' '--enable-trans-sid' '--enable-xml' Edit this bug report at http://bugs.php.net/?id=12243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12243 Updated: Large numbers not behaving as doubles
ID: 12243 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Variables related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.6 New Comment: If this is strictly hardware related, then how come when I run the exact same 2 lines on another box running linux, I get the correct 5 billion number displayed? The linux box is using an AMD 450 Mhz K6, and the FreeBSD box is using a Pentium 3-600. I am not able to back up to 4.03PL1 on the FreeBSD box, but I am quite sure that this problem did not occur back when it was loaded. Previous Comments: [2001-07-18 23:52:41] [EMAIL PROTECTED] 1) longlong != double 2) the scale is HW-dependant, i. e. you need a 64-bit HW to get native support for 64-bit numbers. that's how it's always been in PHP. there was no change WIRT this. 5,000,000,000 is clearly more than your HW can take, so it's clipped to the closest possible value. [2001-07-18 23:34:07] [EMAIL PROTECTED] I've verified that this behavior is relatively new. It does not happen in 4.03PL1, but does in 4.05 and 4.06. [2001-07-18 23:13:02] [EMAIL PROTECTED] $testnumber = 50; echo $testnumber; The result is 2147483647. The variable is of type integer, even though it was initialized with a double value. I first noticed this with PHP 4.05 and it still occurs with 4.05. I do not believe it behaved this way back when I had 4.03PL1 installed. My configure line is: './configure' '--with-gd=no' '--with-mysql=/usr/local' '--with-config-file-path=/usr/home/priraise/phpini' '--enable-debug=no' '--enable-track-vars=yes' '--enable-ftp=yes' '--enable-force-cgi-redirect=yes' '--with-openssl' '--enable-trans-sid' '--enable-xml' Edit this bug report at http://bugs.php.net/?id=12243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12243 Updated: Large numbers not behaving as doubles
ID: 12243 Updated by: cynic Reported By: [EMAIL PROTECTED] Old Status: Bogus Status: Feedback Bug Type: Variables related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.6 New Comment: are you sure you don't initialize the variable with 5 Million on the Linux box? Previous Comments: [2001-07-19 00:03:32] [EMAIL PROTECTED] If this is strictly hardware related, then how come when I run the exact same 2 lines on another box running linux, I get the correct 5 billion number displayed? The linux box is using an AMD 450 Mhz K6, and the FreeBSD box is using a Pentium 3-600. I am not able to back up to 4.03PL1 on the FreeBSD box, but I am quite sure that this problem did not occur back when it was loaded. [2001-07-18 23:52:41] [EMAIL PROTECTED] 1) longlong != double 2) the scale is HW-dependant, i. e. you need a 64-bit HW to get native support for 64-bit numbers. that's how it's always been in PHP. there was no change WIRT this. 5,000,000,000 is clearly more than your HW can take, so it's clipped to the closest possible value. [2001-07-18 23:34:07] [EMAIL PROTECTED] I've verified that this behavior is relatively new. It does not happen in 4.03PL1, but does in 4.05 and 4.06. [2001-07-18 23:13:02] [EMAIL PROTECTED] $testnumber = 50; echo $testnumber; The result is 2147483647. The variable is of type integer, even though it was initialized with a double value. I first noticed this with PHP 4.05 and it still occurs with 4.05. I do not believe it behaved this way back when I had 4.03PL1 installed. My configure line is: './configure' '--with-gd=no' '--with-mysql=/usr/local' '--with-config-file-path=/usr/home/priraise/phpini' '--enable-debug=no' '--enable-track-vars=yes' '--enable-ftp=yes' '--enable-force-cgi-redirect=yes' '--with-openssl' '--enable-trans-sid' '--enable-xml' Edit this bug report at http://bugs.php.net/?id=12243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12243 Updated: Large numbers not behaving as doubles
ID: 12243 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Variables related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.6 New Comment: 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 50. 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. Previous Comments: [2001-07-19 00:15:34] [EMAIL PROTECTED] are you sure you don't initialize the variable with 5 Million on the Linux box? [2001-07-19 00:03:32] [EMAIL PROTECTED] If this is strictly hardware related, then how come when I run the exact same 2 lines on another box running linux, I get the correct 5 billion number displayed? The linux box is using an AMD 450 Mhz K6, and the FreeBSD box is using a Pentium 3-600. I am not able to back up to 4.03PL1 on the FreeBSD box, but I am quite sure that this problem did not occur back when it was loaded. [2001-07-18 23:52:41] [EMAIL PROTECTED] 1) longlong != double 2) the scale is HW-dependant, i. e. you need a 64-bit HW to get native support for 64-bit numbers. that's how it's always been in PHP. there was no change WIRT this. 5,000,000,000 is clearly more than your HW can take, so it's clipped to the closest possible value. [2001-07-18 23:34:07] [EMAIL PROTECTED] I've verified that this behavior is relatively new. It does not happen in 4.03PL1, but does in 4.05 and 4.06. [2001-07-18 23:13:02] [EMAIL PROTECTED] $testnumber = 50; echo $testnumber; The result is 2147483647. The variable is of type integer, even though it was initialized with a double value. I first noticed this with PHP 4.05 and it still occurs with 4.05. I do not believe it behaved this way back when I had 4.03PL1 installed. My configure line is: './configure' '--with-gd=no' '--with-mysql=/usr/local' '--with-config-file-path=/usr/home/priraise/phpini' '--enable-debug=no' '--enable-track-vars=yes' '--enable-ftp=yes' '--enable-force-cgi-redirect=yes' '--with-openssl' '--enable-trans-sid' '--enable-xml' Edit this bug report at http://bugs.php.net/?id=12243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12243 Updated: Large numbers not behaving as doubles
ID: 12243 Updated by: cynic Reported By: [EMAIL PROTECTED] Old Status: Feedback Status: Open Bug Type: Variables related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.6 New Comment: at your service Previous Comments: [2001-07-19 00:23:14] [EMAIL PROTECTED] 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 50. 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] [EMAIL PROTECTED] are you sure you don't initialize the variable with 5 Million on the Linux box? [2001-07-19 00:03:32] [EMAIL PROTECTED] If this is strictly hardware related, then how come when I run the exact same 2 lines on another box running linux, I get the correct 5 billion number displayed? The linux box is using an AMD 450 Mhz K6, and the FreeBSD box is using a Pentium 3-600. I am not able to back up to 4.03PL1 on the FreeBSD box, but I am quite sure that this problem did not occur back when it was loaded. [2001-07-18 23:52:41] [EMAIL PROTECTED] 1) longlong != double 2) the scale is HW-dependant, i. e. you need a 64-bit HW to get native support for 64-bit numbers. that's how it's always been in PHP. there was no change WIRT this. 5,000,000,000 is clearly more than your HW can take, so it's clipped to the closest possible value. [2001-07-18 23:34:07] [EMAIL PROTECTED] I've verified that this behavior is relatively new. It does not happen in 4.03PL1, but does in 4.05 and 4.06. 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/?id=12243 Edit this bug report at http://bugs.php.net/?id=12243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]