-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strtotime returns false when string includes narrow non breaking space character #11600
Comments
Looks like it calls into |
For date or DateTime https://www.php.net/manual/en/datetime.formats.time.php |
Fixed for PHP 8.2.9 — thanks for your report, but please note that your example is not correct. The pattern that comes back from Instead, I had to modify the test to: https://github.com/php/php-src/blob/master/ext/date/tests/bug-gh11600.phpt |
Sweet thanks! Got so focused onthe \u202f character breaking strtotime I missed the extra m breaking it as well. Either way happy it's fixed. |
Description
This is kind of related to #9799
With the ICU 72.1 update, it replaces a ascii space character with a narrow non-breaking space unicode character for intl space So something like
will return
h:mm\u202fa
instead ofh:mm a
.When creating date strings based off that pattern with the NNBS character, and then passing into
strtotime
,strtotime
returns false.With the ICU update, I think functions like
strtotime
should support parsing the NNBS character.The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
8.2.8
Operating System
Redhat Enterprise 8.8
The text was updated successfully, but these errors were encountered: