From:             for-bugs at hnw dot jp
Operating system: any
PHP version:      5.2.8
PHP Bug Type:     Performance problem
Bug description:  mktime() is slow when it gets very small 3rd argument

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 bug report at http://bugs.php.net/?id=46926&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46926&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46926&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46926&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46926&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46926&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46926&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46926&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46926&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46926&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46926&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46926&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46926&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46926&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46926&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46926&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46926&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46926&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46926&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46926&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46926&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46926&r=mysqlcfg

Reply via email to