Skip to content

IntlDateFormatter crashes (SIGSEGV) when dateType is outside expected range #12243

Description

@mrblur

Description

The following code:

<?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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions