2023-07-11 15:29:04 +00:00
|
|
|
--TEST--
|
|
|
|
Bug GH-11600: Intl patterns are not parseable DateTime Strings
|
2023-07-11 21:39:06 +00:00
|
|
|
--EXTENSIONS--
|
|
|
|
intl
|
2023-07-11 15:29:04 +00:00
|
|
|
--INI--
|
|
|
|
date.timezone=UTC
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$formatter = new IntlDateFormatter('en_US', -1, 3);
|
|
|
|
$pattern = $formatter->getPattern();
|
|
|
|
|
|
|
|
$timeString = $formatter->format(strtotime('2023-07-11 16:02'));
|
|
|
|
|
2023-07-12 12:54:56 +00:00
|
|
|
$timestamp = strtotime("2023-07-11 {$timeString}");
|
2023-07-11 15:29:04 +00:00
|
|
|
|
|
|
|
var_dump($pattern, $timeString, $timestamp);
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2023-07-11 21:39:06 +00:00
|
|
|
string(%d) "h:mm%sa"
|
|
|
|
string(%d) "4:02%sPM"
|
2023-07-11 15:29:04 +00:00
|
|
|
int(1689091320)
|