Skip to content

localtime.xml Change the parameter name + nits - #4820

Merged
lacatoire merged 1 commit into
php:masterfrom
mmalferov:patch-35
Sep 1, 2026
Merged

lacatoire merged 1 commit into
php:masterfrom
mmalferov:patch-35

Conversation

@mmalferov

Copy link
Copy Markdown
Member

It looks like the name $parse_pos migrated from the source code. It is better to leave the name $offset in the user land

Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
@Girgias
Girgias requested a review from devnexen January 9, 2026 12:57
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
Comment thread reference/intl/dateformatter/localtime.xml Outdated
offset never comes back as -1: it holds the position at which parsing ended,
on success and on failure alike, verified on PHP 8.5.4 with ext/intl. A value
past the end of the string fails immediately without touching it; on
localtime() and parse() a negative value does too, while parseToCalendar()
exempts -1 from that check.

Also finish the prose cleanup on localtime(): mark up the parameter
references the rename left behind, qualify the localtime() compatibility
claim since tm_yday is 1-based here and 0-based there, and describe the
formatter parameter of parse() as the object it has always been.
@lacatoire
lacatoire merged commit 8871302 into php:master Sep 1, 2026
2 checks passed
@mmalferov
mmalferov deleted the patch-35 branch September 1, 2026 19:53
lacatoire added a commit to php/doc-fr that referenced this pull request Sep 1, 2026
…and parseToCalendar (#3465)

Translation of php/doc-en#4820 (commit 8871302): on return offset holds the
position where parsing ended, whether or not it succeeded, and an out-of-range
offset makes parsing fail immediately while leaving offset untouched. The
localtime return value is described in full. EN-Revision updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants