From: renffeh at yahoo dot com Operating system: Windows XP PHP version: 5.1.1 PHP Bug Type: Performance problem Bug description: date function slower than in 5.0.5
Description: ------------ Has the date function slowed from PHP 5.0.5 to PHP 5.1.1? When testing with the code below, my output is: PHP 5.0.5: 0.044 PHP 5.1.1: 0.938 If I comment out the $d = ... line, my output is: PHP 5.0.5: 0.003 PHP 5.1.1: 0.001 ...so I know it's the date function that is responsible for the slower time. Has anyone else seen evidence of this? (I'm using Windows XP SP2 with the PHP Zip packages) Mike Heffner Reproduce code: --------------- <?php function get_microtime() { list($usec,$sec) = explode(" ",microtime()); return((float)$sec + (float)$usec); } $t1 = get_microtime(); for ($x=0; $x<10000; $x++) { $d = date("Y-m-d H:i:s"); } $t2 = get_microtime(); printf("%.3f\n",($t2-$t1)); ?> -- Edit bug report at http://bugs.php.net/?id=35658&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35658&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35658&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35658&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35658&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35658&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35658&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35658&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35658&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35658&r=support Expected behavior: http://bugs.php.net/fix.php?id=35658&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35658&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35658&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35658&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35658&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35658&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35658&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35658&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35658&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35658&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35658&r=mysqlcfg