1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix bug GH-11600: Can't parse time strings which include (narrow) non-breaking space characters

This commit is contained in:
Derick Rethans
2023-07-11 16:29:04 +01:00
parent b8fe445468
commit a4bdaeabf6
2 changed files with 21 additions and 0 deletions

2
NEWS
View File

@@ -21,6 +21,8 @@ PHP NEWS
- Date:
. Fixed bug GH-11368 (Date modify returns invalid datetime). (Derick)
. Fixed bug GH-11600 (Can't parse time strings which include (narrow)
non-breaking space characters). (Derick)
- DOM:
. Fixed bug GH-11625 (DOMElement::replaceWith() doesn't replace node with

View File

@@ -0,0 +1,19 @@
--TEST--
Bug GH-11600: Intl patterns are not parseable DateTime Strings
--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'));
$timestamp = strtotime($timeString);
var_dump($pattern, $timeString, $timestamp);
?>
--EXPECTF--
string(8) "h:mma"
string(9) "4:02PM"
int(1689091320)