[php-src] Issue #8809: Incorrect timestamp parsing
| From: | GrahamCampbell | Date: | Fri, 17 Jun 2022 10:14:36 +0000 |
| Subject: | [php-src] Issue #8809: Incorrect timestamp parsing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241750@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8809
Author: GrahamCampbell
### Description
The following code:
```php
<?php
new DateTimeImmutable('2022-123-20 22:00');
```
Resulted in this output:
```
```
But I expected this output instead:
```
Fatal error: Uncaught Exception: Failed to parse time string (2022-123-20 22:00) at position 7 (3):
Unexpected character in /in/fFt1B:3
Stack trace:
#0 /in/fFt1B(3): DateTimeImmutable->__construct('2022-123-20 22:...')
#1 {main}
thrown in /in/fFt1B on line 3
```
### PHP Version
8.1.7
### Operating System
_No response_