ID:               46926
 User updated by:  for-bugs at hnw dot jp
 Reported By:      for-bugs at hnw dot jp
 Status:           Open
 Bug Type:         Performance problem
 Operating System: any
 PHP Version:      5.2.8
 New Comment:

I'm sorry, reproduce code depends on my timezone. Replace code as
below:

  $unixtime = mktime(9,0,-2147483647,1,1,1970);

to

  $unixtime = gmmktime(0,0,-2147483647,1,1,1970);

and

  $unixtime = mktime(9,0,2147483646,1,1,1970);

to

  $unixtime = gmmktime(0,0,2147483646,1,1,1970);


Previous Comments:
------------------------------------------------------------------------

[2008-12-22 13:55:06] for-bugs at hnw dot jp

Description:
------------
when it gots very small 3rd argument, mktime() performs 1000 times
slower than ordinary case.


Reproduce code:
---------------
<?php

$mt0 = microtime(true);
for($i=0;$i<10;$i++){
  $unixtime = mktime(9,0,-2147483647,1,1,1970);
}
$mt1 = microtime(true);
for($i=0;$i<10;$i++){
  $unixtime = mktime(9,0,2147483646,1,1,1970);
}
$mt2 = microtime(true);
printf("%.6f\n%.6f\n", $mt1-$mt0, $mt2-$mt1);

// This will output
// 5.139942
// 0.000707
// on my machine

Actual result:
--------------
see reproduce code


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46926&edit=1

Reply via email to