php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bo at theaddedones dot com
New email:
PHP Version: OS:

 

 [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 commitsRelated reports
 [2005-07-01 17:17 UTC] derick@php.net
This is already on my todo list...
 [2005-07-01 17:25 UTC] bo at theaddedones dot com
oops

sorry if i duped a bug (could not find one like it yet) 
thanks for your time
 [2005-07-03 23:38 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC