From: glaesser at whsoft dot de
Operating system: Debian4, php 5.2.0-8+etch11
PHP version: 5.2.6
PHP Bug Type: Reproducible crash
Bug description: Script causes infinite loop
Description:
------------
Following script works perfect on PHP 5.0.5-Debian-0.8~sarge1 but it
produces infinite loops on PHP 5.1.2 or PHP 5.2.0-8+etch11.
Reproduce code:
---------------
$testArray = array();
$testArray[] = array('ueberdat' => '2008-04-01', 'rueckdat' =>
'2008-04-06');
$testArray[] = array('ueberdat' => '2008-04-12', 'rueckdat' =>
'2008-04-26');
$testArray[] = array('ueberdat' => '2008-04-26', 'rueckdat' =>
'2008-05-03');
$testArray[] = array('ueberdat' => '2008-05-10', 'rueckdat' =>
'2008-05-20');
$testArray[] = array('ueberdat' => '2008-05-24', 'rueckdat' =>
'2008-06-07');
$testArray[] = array('ueberdat' => '2008-06-14', 'rueckdat' =>
'2008-06-21');
$testArray[] = array('ueberdat' => '2008-06-21', 'rueckdat' =>
'2008-06-28');
$testArray[] = array('ueberdat' => '2008-06-28', 'rueckdat' =>
'2008-07-05');
$testArray[] = array('ueberdat' => '2008-07-05', 'rueckdat' =>
'2008-07-12');
$testArray[] = array('ueberdat' => '2008-07-19', 'rueckdat' =>
'2008-07-26');
$testArray[] = array('ueberdat' => '2008-07-26', 'rueckdat' =>
'2008-08-02');
$testArray[] = array('ueberdat' => '2008-08-02', 'rueckdat' =>
'2008-08-16');
$testArray[] = array('ueberdat' => '2008-08-23', 'rueckdat' =>
'2008-09-06');
$testArray[] = array('ueberdat' => '2008-09-13', 'rueckdat' =>
'2008-09-20');
$testArray[] = array('ueberdat' => '2008-09-27', 'rueckdat' =>
'2008-10-04');
$testArray[] = array('ueberdat' => '2008-10-11', 'rueckdat' =>
'2008-10-15');
$testArray[] = array('ueberdat' => '2008-10-25', 'rueckdat' =>
'2008-11-02');
$arrRet = array();
foreach ($testArray as $testValue) {
$startDat = $testValue['ueberdat'];
while ($startDat < $testValue['rueckdat']) {
$arrRet[] = array('belDat' => $startDat);
$startDat = date("Y-m-d", strtotime($startDat)+86400);
}
}
print_r($arrRet);
Expected result:
----------------
I want all days from the given dates like...
Array
(
[0] => Array
(
[belDat] => 2008-04-01
)
[1] => Array
(
[belDat] => 2008-04-02
)
[2] => Array
(
[belDat] => 2008-04-03
)
[3] => Array
(
[belDat] => 2008-04-04
)
[4] => Array
(
[belDat] => 2008-04-05
)
[5] => Array
(
[belDat] => 2008-04-12
)
[6] => Array
(
[belDat] => 2008-04-13
)
[7] => Array
(
[belDat] => 2008-04-14
)
[8] => Array
(
[belDat] => 2008-04-15
)
... and so on
Actual result:
--------------
Script timeout on new PHP-Version.
--
Edit bug report at http://bugs.php.net/?id=45403&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45403&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45403&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45403&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45403&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45403&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45403&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45403&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45403&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45403&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45403&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45403&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45403&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45403&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45403&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45403&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45403&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45403&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45403&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45403&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45403&r=mysqlcfg