Bug #68988 [NEW]: strtotime returns beyond the expected
| From: | wanting_e at 163 dot com | Date: | Thu, 05 Feb 2015 09:42:56 +0000 |
| Subject: | Bug #68988 [NEW]: strtotime returns beyond the expected | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190475@lists.php.net to get a copy of this message | ||
From: wanting_e at 163 dot com
Operating system: ubuntu 13.04
PHP version: 5.5.21
Package: Scripting Engine problem
Bug Type: Bug
Bug description:strtotime returns beyond the expected
Description:
------------
I passed two different timestamp to strtotime() function.
I expected both of them will returns false, but the second one returns a
big int!
Test script:
---------------
<?php
date_default_timezone_set("Asia/Shanghai");
echo date('Y-m-d H:i:s', 1423122337) . '<br/>'; //2015-02-05 15:45:37
echo date('Y-m-d H:i:s', 1738598400) . '<br/>'; //2025-02-04 00:00:00
var_dump(strtotime('1423122337')); //bool(false)
var_dump(strtotime('1738598400')); //int(202914236339)
Expected result:
----------------
2015-02-05 15:45:37
2025-02-04 00:00:00
bool(false)
bool(false)
Actual result:
--------------
2015-02-05 15:45:37
2025-02-04 00:00:00
bool(false)
int(202914236339)
--
Edit bug report at https://bugs.php.net/bug.php?id=68988&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68988&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68988&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68988&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68988&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68988&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68988&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68988&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68988&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68988&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68988&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68988&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68988&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68988&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68988&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68988&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68988&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68988&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68988&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68988&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68988&r=mysqlcfg