php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25665 var_dump/print_r hang on NaN and INF
Submitted: 2003-09-25 23:21 UTC Modified: 2005-12-14 01:00 UTC
Votes:10
Avg. Score:3.9 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:3 (37.5%)
Same OS:2 (25.0%)
From: eru@php.net Assigned: helly (profile)
Status: No Feedback Package: *General Issues
PHP Version: 5CVS, 4CVS OS: *
Private report: No CVE-ID: None
 [2003-09-25 23:21 UTC] eru@php.net
Description:
------------
Summary and reproducing code say all...

I tested it on a 4.3.0 and got 

NAN
-INF
float(0.E+79)
float(-0.E+79)

which isn't correct on the var_dump behaviour either, but at least I hadn't had a hanging program.


Reproduce code:
---------------
<?php
print_r(acos(1.01));
print_r(log(0));
var_dump(acos(1.01));
var_dump(log(0));
?>


Expected result:
----------------
Some output saying NaN and INF.

Actual result:
--------------
Nothing. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-26 05:46 UTC] sniper@php.net
It's the ap_php_cvt() which ends up in endless loop since it can't handle infinite numbers at all. In PHP 4.2.3 the output
of var_dump(log(0)); is float(-INF)..

Marcus..you broke this, fix it.

 [2003-09-28 21:07 UTC] iliaa@php.net
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 http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2004-06-03 11:04 UTC] neilus at dcs dot kcl dot ac dot uk
this is re-occurring in the 4.3 branch tests, so either the test or bug needs to be fixed
 [2004-06-03 20:42 UTC] helly@php.net
Which platform are you running?
 [2004-06-18 14:18 UTC] scott_heffner at hotmail dot com
Can't speak for the original poster, but I've run into this issue on Solaris 8 for x86.

Thanks
 [2004-06-18 20:49 UTC] helly@php.net
Could you please edit the following file:
ext/standard/tests/math/bug25665.phpt
and duplicate the '-INF' lines to also test 'INF'?

Then please report the output of 
php run-tests.php ext/standard/tests/math/bug25665.phpt

I suspect all but -INF works, right?
 [2005-10-08 11:09 UTC] nohn@php.net
Could reproduce that bug with 4.4.1RC1 on Cygwin
 [2005-10-08 14:28 UTC] sniper@php.net
Assigned to the maintainer of this part.. :)

 [2005-10-09 10:45 UTC] nohn@php.net
Could reproduce it also on Solaris 10 (Sparc) with latest 4CVS
 [2005-10-18 15:42 UTC] nohn@php.net
Could reproduce with 5.1.0RC3 on Cygwin
 [2005-12-07 00:26 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2005-12-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, 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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 05:01:28 2024 UTC