#35658 [Opn->Fbk]: date function slower than in 5.0.5
| From: | derick@php.net | Date: | Tue, 13 Dec 2005 12:00:57 +0000 |
| Subject: | #35658 [Opn->Fbk]: date function slower than in 5.0.5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90352@lists.php.net to get a copy of this message | ||
ID: 35658
Updated by: derick@php.net
Reported By: renffeh at yahoo dot com
-Status: Open
+Status: Feedback
Bug Type: Performance problem
Operating System: Windows XP
PHP Version: 5.1.1
New Comment:
Do you have error reporting set to E_ALL | E_STRICT?
Previous Comments:
------------------------------------------------------------------------
[2005-12-13 12:57:12] renffeh at yahoo dot com
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 this bug report at http://bugs.php.net/?id=35658&edit=1