From: robin_fernandes at uk dot ibm dot com Operating system: Windows PHP version: 5.2.3 PHP Bug Type: Date/time related Bug description: Intermittent failure of test bug35885.phpt
Description: ------------ Test http://lxr.php.net/source/php-src/ext/date/tests/bug35885.phpt compares two time stamps representing the current time. However, these timestamps are seized in separate statements. The comparison fails intermittently, because the seconds occasionally tick over between the two calls. Below is bug35885.phpt enclosed in a loop to prove that it fails intermittently. It will break out of the loop on failure. Expected time to failure is less than 10 seconds. Reproduce code: --------------- <?php date_default_timezone_set("UTC"); while (true) { $ts = date(DATE_ISO8601, strtotime('NOW')); $ts2 = date(DATE_ISO8601, time()); $res = ($ts == $ts2); var_dump($res); if (!$res) { var_dump($ts); var_dump($ts2); break; } } ?> Expected result: ---------------- N/A (loop) Actual result: -------------- bool(true) bool(true) [...] bool(true) bool(false) string(24) "2007-08-15T13:26:05+0000" string(24) "2007-08-15T13:26:06+0000" -- Edit bug report at http://bugs.php.net/?id=42311&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42311&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42311&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42311&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42311&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42311&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42311&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42311&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42311&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42311&r=support Expected behavior: http://bugs.php.net/fix.php?id=42311&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42311&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42311&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42311&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42311&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42311&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42311&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42311&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42311&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42311&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42311&r=mysqlcfg
