|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-12-30 06:58 UTC] exploringbinary at gmail dot com
Description: ------------ If I assign the value 2.2250738585072011e-308 to a variable, e.g. $d = 2.2250738585072011e-308, PHP hangs (loops). I am using PHP 5.3.1 XAMPP 1.7.3 on Windows. 2.2250738585072011e-308 represents the largest subnormal double-precision floating-point number, 0.1111111111111111111111111111111111111111111111111111 x 2^-1022. Interestingly, nearby decimal literals 2.2250738585072008e-308, 2.2250738585072009e-308, 2.2250738585072010e-308 and 2.2250738585072012e-308 -- which all convert to the same floating-point value -- do not cause this problem. Test script: --------------- <?php $d = 2.2250738585072011e-308; ?> Expected result: ---------------- No Hang. Actual result: -------------- Hang. PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
It hangs on Debian: aquilax@zelda /tmp> php -v PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/adodb.so' - /usr/lib/php5/20090626+lfs/adodb.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 5.3.3-6 with Suhosin-Patch (cli) (built: Dec 7 2010 18:23:49) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH aquilax@zelda /tmp> cat t.php <?php $d = 2.2250738585072011e-308; ?> aquilax@zelda /tmp> time php t.php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/adodb.so' - /usr/lib/php5/20090626+lfs/adodb.so: cannot open shared object file: No such file or directory in Unknown on line 0 ^CCommand terminated by signal 2 7.55user 0.02system 0:07.61elapsed 99%CPU (0avgtext+0avgdata 36720maxresident)k 0inputs+0outputs (0major+2620minor)pagefaults 0swapsCheck out the strace: lstat64("/home/ubuntu/junk/p.php", {st_mode=S_IFREG|0644, st_size=59, ...}) = 0 lstat64("/home/ubuntu/junk", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat64("/home/ubuntu", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat64("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfe51238) = -1 ENOTTY (Inappropriate ioctl for device) fstat64(3, {st_mode=S_IFREG|0644, st_size=59, ...}) = 0 mmap2(NULL, 68, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb78d1000 and then it hangs...