From:
Operating system: Linux 2.6.38 amd64
PHP version: 5.3.6
Package: Date/time related
Bug Type: Bug
Bug description:On 64 bit strtotime() mishandles all-zero timestamps
Description:
------------
The behavior of strtotime() on 64 bit machines (see below) for all-zero
timestamps is undesirable. On 32 bit machines the function outputs NULL
for a string input "0000-00-00 00:00", on 64 bit machines it yields
-62169987600. This is undesirable, as the all-zero timestamp is not a
valid date ("00" is not a month). On 64 bit systems strtotime() should
return NULL for "0000-00-00 00:00".
Test script:
---------------
/* Linux ubuntu64-vbox 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04
UTC
* 2011 x86_64 x86_64 x86_64 GNU/Linux
* PHP 5.3.6-6~dotdeb.1 with Suhosin-Patch (cli) (built: Apr 3 2011
16:36:05)
*/
<?php
echo strtotime("0000-00-00 00:00");
?>
Actual result:
--------------
-62169987600
--
Edit bug report at https://bugs.php.net/bug.php?id=55252&edit=1
--
Try a snapshot (PHP 5.2):
https://bugs.php.net/fix.php?id=55252&r=trysnapshot52
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55252&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=55252&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55252&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=55252&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55252&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=55252&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=55252&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=55252&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=55252&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=55252&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=55252&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=55252&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55252&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=55252&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55252&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=55252&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=55252&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=55252&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=55252&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=55252&r=mysqlcfg
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55252&r=trysnapshot54