From: ronlentjes at yahoo dot com dot au
Operating system: Linux Fedora 8
PHP version: 5.3.0
PHP Bug Type: Scripting Engine problem
Bug description: Floating point NaN cause garbage characters
Description:
------------
This has been an issue since 4.2.2 and still in 5.3.0.
$d = pow (-1.0, 0.3); // or anything causing NaN
echo "$d\n";
-> NAN
printf ("%f\n", $d);
(4.2.2) -> crash
(5.2.4) -> NaN<big-box><little-box><E-with-backslash-on-top>
(5.3.0) -> NaN<hex EF BF BD><hex EF BF BD><hex EF BF BD>
(viewed in browser as NaN???)
Two issues here:
Inconsistent display of NAN for echo and NaN for printf.
Output of bogus characters after the 3 letters NaN for printf.
I think you are missing a '\0' null termination after the NaN characters
which probably cause a runaway to crash 4.2.2 but is just 'hanging' in
there for the newer versions.
Cheers,
Ron Lentjes
LC CLS.
Reproduce code:
---------------
$d = pow (-1.0, 0.3);
echo "$d\n";
printf ("%f\n", $d);
Expected result:
----------------
NaN
NaN
Actual result:
--------------
(4.2.2)
NAN
crash
(5.2.4)
NAN
NaN<big-box><little-box><E-with-backslash-on-top>
(5.3.0)
NAN
NaN<hex EF BF BD><hex EF BF BD><hex EF BF BD>
(viewed in browser as NaN???)
--
Edit bug report at http://bugs.php.net/?id=49244&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49244&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49244&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49244&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49244&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=49244&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49244&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=49244&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=49244&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=49244&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=49244&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=49244&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=49244&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=49244&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49244&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49244&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49244&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=49244&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=49244&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=49244&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=49244&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=49244&r=mysqlcfg