Bug #67324 [NEW]: DateTime::createFromFormat wrong result
| From: | volny dot licvin at gmail dot com | Date: | Thu, 22 May 2014 11:42:21 +0000 |
| Subject: | Bug #67324 [NEW]: DateTime::createFromFormat wrong result | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185892@lists.php.net to get a copy of this message | ||
From: volny dot licvin at gmail dot com
Operating system: Linux
PHP version: Irrelevant
Package: *General Issues
Bug Type: Bug
Bug description:DateTime::createFromFormat wrong result
Description:
------------
DateTime::createFromFormat not checking properly provided format (day
[01-31] and month [01-12] limitations) and only checking number of
digits.
Test script:
---------------
<?php
var_dump(DateTime::createFromFormat('Y-m-d', '9999-99-99'));
Expected result:
----------------
bool(false)
Actual result:
--------------
object(DateTime)#9 (3) {
["date"]=>
string(20) "10007-06-07 13:28:21"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Berlin"
}
--
Edit bug report at https://bugs.php.net/bug.php?id=67324&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67324&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67324&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67324&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67324&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67324&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67324&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67324&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67324&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67324&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67324&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67324&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67324&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67324&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67324&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67324&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67324&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67324&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67324&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67324&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67324&r=mysqlcfg