|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-27 22:35 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
Description: ------------ While switching a calendar script from PHP4 to PHP5 I noticed the script takes multiple times as long to complete in PHP5 than it did in PHP4. The problem seems to be date() and mktime() functions. I did not notice any other PHP5 related performance issues. Scripts that do not use date() or mktime() run very fast. Reproduce code: --------------- test.php: <? for ($i=0;$i<100000;$i++) { date('d'); } ?> Now check this script with both PHP4 and PHP5: time php4 test.php time php5 test.php Expected result: ---------------- The script should take about the same time in both PHP4 and PHP5 Actual result: -------------- time php4 test.php real 0m0.286s user 0m0.034s sys 0m0.252s time php5 test.php real 0m25.252s user 0m18.579s sys 0m5.615s