#33536 [Asn->Csd]: strtotime defaults to now even on non time string
ID: 33536
Updated by: derick@php.net
Reported By: bo at theaddedones dot com
-Status: Assigned
+Status: Closed
Bug Type: Date/time related
Operating System: OSX
PHP Version: 5CVS-2005-07-01 (dev)
Assigned To: derick
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2005-07-01 17:25:15] 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-01 17:17:07] derick@php.net
This is already on my todo list...
------------------------------------------------------------------------
[2005-07-01 17:12:39] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33536&edit=1
Thread (4 messages)