From: Operating system: Linux 2.6.35.7 x86_64 PHP version: 5.2.16 Package: Unknown/Other Function Bug Type: Bug Bug description:mktime() produces invalid results under 64-bit
Description: ------------ It appears that when the PHP binary was compiled against 64-bit libraries, mktime() seems to only do minimal error checking of parms. After some additional testing, if found the following results: PHP Code: $t=mktime(0,0,0,12,3,292277026596); var_dump($t); $t=mktime(0,0,0,12,3,292277026597); var_dump($t); $t=mktime(900000000000,900000000000,900000000000,900000000000,900000000000,90000 0000000); var_dump($t); int(9223372036854655200) int(-9223372036823360416) int(-6044405109589065632) It appears that once the parm value exceeds the value limit of a long var, the function returns a negative value. No warnings are produced. Instead of returning FALSE for an error, the function just returns an invalid result. Some additional info here: http://phpbuilder.com/board/showthread.php? p=10971046#post10971046 Test script: --------------- $t=mktime(0,0,0,12,3,292277026596); var_dump($t); $t=mktime(0,0,0,12,3,292277026597); var_dump($t); $t=mktime(900000000000,900000000000,900000000000,900000000000,900000000000,900000000000); var_dump($t); int(9223372036854655200) int(-9223372036823360416) int(-6044405109589065632) Expected result: ---------------- Return FALSE if parms are invalid. Actual result: -------------- Invalid values. Does not return FALSE. -- Edit bug report at http://bugs.php.net/bug.php?id=53608&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53608&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53608&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53608&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53608&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53608&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53608&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53608&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53608&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53608&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53608&r=support Expected behavior: http://bugs.php.net/fix.php?id=53608&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53608&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53608&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53608&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53608&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53608&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53608&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53608&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53608&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53608&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53608&r=mysqlcfg
