-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug GH-11600: Can't parse time strings which include (narrow) non…
…-breaking space characters
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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:mm a" | ||
string(9) "4:02 PM" | ||
int(1689091320) |
a4bdaea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derickr This test fails on some of the CI targets, and succeeds on others. I believe this is because the Linux ones already use a newer libicu version, while macOS still uses an older one.
Therefore, the output between them differs.
EDIT: also the intl extension line is missing in the extensions section
EDIT 2: I filed #11684, let's see if CI is happy now