|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25949 var_dump endless loops with NAN or INF float
Submitted: 2003-10-22 06:17 UTC Modified: 2003-10-22 09:40 UTC
From: alefor at gmx dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.3 OS: Debian/unstable r3.01 GNU/Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: alefor at gmx dot de
New email:
PHP Version: OS:


 [2003-10-22 06:17 UTC] alefor at gmx dot de
var_dump a float with inf/nan value lead to an endless loop.
Same result for cli php and for apache module.
GDB backtrace follows, taken suspending the endless loop execution.
(gdb) bt
#0  0x0810bd85 in ap_php_cvt ()
#1  0x0810bfd6 in ap_php_ecvt ()
#2  0x0810c05d in ap_php_gcvt ()
#3  0x0810c86a in ap_php_gcvt ()
#4  0x0810ccd6 in vspprintf ()
#5  0x08108ef8 in php_printf ()
#6  0x080e7507 in php_var_dump ()
#7  0x080e77a5 in zif_var_dump ()
#8  0x081400e7 in execute ()
#9  0x08133349 in zend_execute_scripts ()
#10 0x0810b5fd in php_execute_script ()

ap_php_cvt family is in main/snprintf.c file.

Reproduce code:
$str = "inf ";
$f = (float)$str;

Expected result:
Don't know. Maybe "float(INF)" ?

Actual result:
Endless loop. No output.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-22 06:29 UTC] alefor at gmx dot de
Simpler test code: var_dump((float)inf);
 [2003-10-22 09:40 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 12:01:27 2021 UTC