[php-src] Issue #12243: IntlDateFormatter crashes (SIGSEGV) when dateType is outside recognized range
| From: | mrblur | Date: | Tue, 19 Sep 2023 08:49:33 +0000 |
| Subject: | [php-src] Issue #12243: IntlDateFormatter crashes (SIGSEGV) when dateType is outside recognized range | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245397@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12243
Author: mrblur
### Description
The following code:
```php
<?php
$datetime = new \DateTime('2017-05-12 23:11:00 GMT+2');
$formatter = new IntlDateFormatter(
locale: 'en',
dateType: -2,
timeType: 0,
timezone: $datetime->getTimezone(),
);
var_dump($formatter->format($datetime));
```
Resulted in this output:
```
SIGSEGV
```
But I expected this output instead:
```
false
```
### PHP Version
PHP 8.1.22
### Operating System
_No response_