strtotime defaults to now even on non time string
| Bug #33536 | strtotime defaults to now even on non time string | ||||
|---|---|---|---|---|---|
| Submitted: | 2005-07-01 17:12 UTC | Modified: | 2005-07-03 23:38 UTC | ||
| From: | bo at theaddedones dot com | Assigned: | derick (profile) | ||
| Status: | Closed | Package: | Date/time related | ||
| PHP Version: | 5CVS-2005-07-01 (dev) | OS: | OSX | ||
| Private report: | No | CVE-ID: | None | ||
[2005-07-01 17:12 UTC] bo at theaddedones dot com
Description:
------------
best by example
---snip---
print strtotime("monkey") ."\n";
print date("Y-m-d", strtotime("monkey")) ."\n";
exit;
---snip---
OUTPUT
1120230396
2005-07-01
---
who knew that monkey meant 'now' (it also defaults to now on various other strings)
Reproduce code:
---------------
<?php
print strtotime("monkey") ."\n";
print date("Y-m-d", strtotime("monkey")) ."\n";
exit;
?>
Expected result:
----------------
i expect to see 'false'
Actual result:
--------------
1120230396
2005-07-01
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-07-01 17:17 UTC] derick@php.net
[2005-07-01 17:25 UTC] bo at theaddedones dot com
[2005-07-03 23:38 UTC] derick@php.net