Bug #81347 [NEW]: 2021-03-34 is correct date for DateTime::createFromFormat()
From: artyomnsk2012 at gmail dot com
Operating system: Ubuntu
PHP version: 8.0.9
Package: Date/time related
Bug Type: Bug
Bug description:2021-03-34 is correct date for DateTime::createFromFormat()
Description:
------------
2021-03-34 00:00:00 is correct date for \DateTime::createFromFormat()
var_dump( \DateTime::createFromFormat('Y-m-d H:i:s', '2021-03-34
00:00:00') ) shows
```
class DateTime#1 (3) {
public $date =>
string(26) "2021-04-03 00:00:00.000000"
public $timezone_type =>
int(3)
public $timezone =>
string(3) "UTC"
}
```
Expected behaviour is false or null
Test script:
---------------
var_dump( \DateTime::createFromFormat('Y-m-d H:i:s', '2021-03-34
00:00:00') );
--
Edit bug report at https://bugs.php.net/bug.php?id=81347&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81347&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81347&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81347&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81347&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81347&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81347&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81347&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81347&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81347&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81347&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81347&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81347&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81347&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81347&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81347&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81347&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81347&r=mysqlcfg
Thread (2 messages)
- artyomnsk2012 at gmail dot com