php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35340 Apache2 needs 100% CPU when passed a float
Submitted: 2005-11-22 21:38 UTC Modified: 2005-12-07 01:00 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: gggiuly at gmail dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 4.4.1 OS: GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
46 - 35 = ?
Subscribe to this entry?

 
 [2005-11-22 21:38 UTC] gggiuly at gmail dot com
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%

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-22 21:43 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

Can't reproduce.
 [2005-12-07 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-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 08 16:05:45 2022 UTC