Add support for -1 as valid year for idate() output.#22657
Merged
Conversation
ndossche
reviewed
Jul 9, 2026
| case 'U': retval = (int) t->sse; break; | ||
| case 'U': *result = (int) t->sse; break; | ||
|
|
||
| default: |
Member
There was a problem hiding this comment.
The duplicated error handling is a bit ugly.
One way to solve this is have a bool success = true; at the top, then return success; at the bottom, then the default case reduces to success = false;
| bool ts_is_null = 1; | ||
| int ret; | ||
| int ret = 0; | ||
| bool ok = false; |
Member
There was a problem hiding this comment.
Just merge the declaration into the assignment line. Reducing variable scopes in general reduces the risk of using (or overwriting) a variable in a place where you shouldn't be able to use it.
84fd759 to
a60c8c6
Compare
ndossche
reviewed
Jul 10, 2026
| PHPAPI zend_long php_parse_date(const char *string, zend_long *now); | ||
| PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, bool gmt); | ||
| PHPAPI int php_idate(char format, time_t ts, bool localtime); | ||
| PHPAPI bool php_idate(char format, time_t ts, bool localtime, int *result); |
Member
There was a problem hiding this comment.
This change should be listed in UPGRADING.INTERNALS.
Member
There was a problem hiding this comment.
Oh you force pushed this, okay then
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.
Closes GH-13273