From: gggiuly at gmail dot com
Operating system: GNU/Linux
PHP version: 4.4.1
PHP Bug Type: Performance problem
Bug description: Apache2 needs 100% CPU when passed a float
Description:
------------
THe CPU-Usage raises to 98% when a float was passed to this function,
which definitifely shouldn't happen.
Can be fixed with stars((int) 4.7) but shouldn't
Reproduce code:
---------------
function stars($full) {
for($i=0; $i<$full; $i++)
$toRet .= '<img src="images/star1.gif" width="10" height="10"
border="0">';
for($i=$full;$i<5;$i++)
$toRet .= '<img src="images/star2.gif" width="10" height="10"
border="0">';
return $toRet;
}
stars(3.4);
Expected result:
----------------
4x star1.gif, 1x star2.gif
Actual result:
--------------
Apache raises CPU-Usage at 98%
--
Edit bug report at http://bugs.php.net/?id=35340&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35340&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35340&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35340&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35340&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35340&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35340&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35340&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35340&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35340&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35340&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35340&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35340&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35340&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35340&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35340&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35340&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35340&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35340&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35340&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35340&r=mysqlcfg