Add missing 8.0.0 changelog for datetime functions no longer returning false#5461
Open
KentarouTakeda wants to merge 1 commit intophp:masterfrom
Open
Add missing 8.0.0 changelog for datetime functions no longer returning false#5461KentarouTakeda wants to merge 1 commit intophp:masterfrom
KentarouTakeda wants to merge 1 commit intophp:masterfrom
Conversation
jordikroon
reviewed
Apr 4, 2026
Contributor
jordikroon
left a comment
There was a problem hiding this comment.
This looks good to me, just some minor nits since exceptionname is preferred for throwables.
| <entry>8.0.0</entry> | ||
| <entry> | ||
| This function no longer returns &false; on failure, but throws a | ||
| <classname>TypeError</classname> instead. |
Contributor
There was a problem hiding this comment.
Suggested change
| <classname>TypeError</classname> instead. | |
| <exceptionname>TypeError</exceptionname> instead. |
| <entry>8.0.0</entry> | ||
| <entry> | ||
| This function no longer returns &false; on failure, but throws a | ||
| <classname>TypeError</classname> instead. |
Contributor
There was a problem hiding this comment.
Suggested change
| <classname>TypeError</classname> instead. | |
| <exceptionname>TypeError</exceptionname> instead. |
| <entry>8.0.0</entry> | ||
| <entry> | ||
| This function no longer returns &false; on failure, but throws a | ||
| <classname>TypeError</classname> instead. |
Contributor
There was a problem hiding this comment.
Suggested change
| <classname>TypeError</classname> instead. | |
| <exceptionname>TypeError</exceptionname> instead. |
| <entry>8.0.0</entry> | ||
| <entry> | ||
| This function no longer returns &false; on failure, but throws a | ||
| <classname>TypeError</classname> instead. |
Contributor
There was a problem hiding this comment.
Suggested change
| <classname>TypeError</classname> instead. | |
| <exceptionname>TypeError</exceptionname> instead. |
| <entry>8.0.0</entry> | ||
| <entry> | ||
| This function no longer returns &false; on failure, but throws a | ||
| <classname>TypeError</classname> instead. |
Contributor
There was a problem hiding this comment.
Suggested change
| <classname>TypeError</classname> instead. | |
| <exceptionname>TypeError</exceptionname> instead. |
| <entry>8.0.0</entry> | ||
| <entry> | ||
| This function no longer returns &false; on failure, but throws a | ||
| <classname>TypeError</classname> instead. |
Contributor
There was a problem hiding this comment.
Suggested change
| <classname>TypeError</classname> instead. | |
| <exceptionname>TypeError</exceptionname> instead. |
| <entry>8.0.0</entry> | ||
| <entry> | ||
| This function no longer returns &false; on failure, but throws a | ||
| <classname>TypeError</classname> instead. |
Contributor
There was a problem hiding this comment.
Suggested change
| <classname>TypeError</classname> instead. | |
| <exceptionname>TypeError</exceptionname> instead. |
…g false In PHP 7.x, several datetime functions returned `false` on parameter parsing failure. PHP 8.0 changed this to throw `TypeError` instead (per RFC: Consistent type errors for internal functions). This changelog entry was already documented for `DateTimeZone::listIdentifiers`/`timezone_identifiers_list`, but was missing from the following functions: - `date()` - `gmdate()` - `localtime()` - `getdate()` - `date_parse()` - `date_parse_from_format()` - `date_sun_info()` Functions that still return `false` from their own logic (e.g. `strtotime()`, `mktime()`, `date_create()`) are not included, as the parameter parsing change is not observable in their return types. The issue also requests reverting the return value description to mention `false`, but the old text was inaccurate (non-numeric strings were coerced to `0`, not rejected) and was intentionally removed in phpGH-2130. Closes php#5460
969c786 to
0316846
Compare
Contributor
Author
|
Thanks for the review! Good catch — I've updated all occurrences to use |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In PHP 7.x, several datetime functions returned
falseon parameter parsing failure. PHP 8.0 changed this to throwTypeErrorinstead (per RFC: Consistent type errors for internal functions).This changelog entry was already documented for
DateTimeZone::listIdentifiers/timezone_identifiers_list, but was missing from the following functions:date()gmdate()localtime()getdate()date_parse()date_parse_from_format()date_sun_info()Functions that still return
falsefrom their own logic (e.g.strtotime(),mktime(),date_create()) are not included, as the parameter parsing change is not observable in their return types.The issue also requests reverting the return value description to mention
false, but the old text was inaccurate (non-numeric strings were coerced to0, not rejected) and was intentionally removed in #2130.Closes #5460