From:             joel at digitalparadise dot net
Operating system: Windows 2000 Server
PHP version:      5.2.4
PHP Bug Type:     Reproducible crash
Bug description:  Calculation not taking place

Description:
------------
This code is part of a larger while loop which stops when "$dayloop ==
false".

This page is a report of employee clock-in and clock-out times.  It shows
the employee, followed by each day that the report includes, and their
times.

This code works in some circumstances, but most of the time, the 3rd line
simply does not execute, or rather the value is never updated - thus
resulting in an endless loop (because $dayloop stays true).

It used to work perfectly (for over 6 months...) on several versions of
PHP, so I do not believe this to be something version-related.

Reproduce code:
---------------
At this point, $thisday would be a date in the format "YYYY-mm-dd".

$timestamp = strtotime($thisday);
$timestamp = $timestamp + (60 * 60 * 24);  <-- this line does not work
if ($timestamp > strtotime($enddate)) {
   $dayloop = false;
}
$thisday = date("Y-m-d", $timestamp);      <-- creates the above value

Expected result:
----------------
$timestamp = $timestamp + (60 * 60 * 24) 

I expect the value of $timestamp to increase by 86400.

Actual result:
--------------
Sometimes the code works for a few cycles, but eventually it will stop
incrementing the value of $timestamp and the script will time out.

-- 
Edit bug report at http://bugs.php.net/?id=43208&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43208&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43208&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43208&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43208&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43208&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43208&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43208&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43208&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43208&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43208&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43208&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43208&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43208&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43208&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43208&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43208&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43208&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43208&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43208&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43208&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43208&r=mysqlcfg

Reply via email to