You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
strtotime returns false when string includes narrow non breaking space character #11600
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 getPattern() is h:mm&nnbsp;a — which when formatting does the m (the minutes) twice, resulting in something like 04:3232 PM that can not be parsed.
Activity
ndossche commentedon Jul 6, 2023
Looks like it calls into
timelib_strtotime()so this needs changes in timelib, if this change is wanted.hormus commentedon Jul 10, 2023
For date or DateTime https://www.php.net/manual/en/datetime.formats.time.php
fornat ICU h:mm a or h:mm\u202fa missing for date or DateTime.
change date('now') to strtotime('now')
Fix bug GH-11600: Can't parse time strings which include (narrow) non…
derickr commentedon Jul 11, 2023
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
getPattern()ish:mm&nnbsp;a— which when formatting does them(the minutes) twice, resulting in something like04:3232 PMthat can not be parsed.Instead, I had to modify the test to: https://github.com/php/php-src/blob/master/ext/date/tests/bug-gh11600.phpt
myleshyson commentedon Jul 11, 2023
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.