Skip to content

Fix stubs of DateTimeZone->getTransitions - #17992

Merged
DanielEScherzer merged 2 commits into
php:masterfrom
marc-mabe:patch-1
Jun 4, 2025
Merged

Fix stubs of DateTimeZone->getTransitions#17992
DanielEScherzer merged 2 commits into
php:masterfrom
marc-mabe:patch-1

Conversation

@marc-mabe

Copy link
Copy Markdown
Contributor

The default value of timestamp_end is INT32_MAX and not ZEND_LONG_MAX.

Additionally, changing the default to ZEND_LONG_MAX would result in an OOM error on calling the function without params.

@kocsismate kocsismate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@derickr

derickr commented Mar 28, 2025

Copy link
Copy Markdown
Member

Isn't there a similar issue with the start time? Shouldn't that not be -2147483648 instead of PHP_INT_MIN ?

@marc-mabe

marc-mabe commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

@derickr it's defined as zend_long timestamp_begin = ZEND_LONG_MIN, timestamp_end = INT32_MAX; - see https://github.com/php/php-src/blob/php-8.4.5/ext/date/php_date.c#L4317

@derickr derickr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right. LGTM, but it looks like you need to rebase first.

marc-mabe and others added 2 commits May 26, 2025 17:45
The default value of `timestamp_end` is INT32_MAX and not ZEND_LONG_MAX
@marc-mabe

Copy link
Copy Markdown
Contributor Author

Ah, you're right. LGTM, but it looks like you need to rebase first.

done

@DanielEScherzer DanielEScherzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CircleCI failure was my fault and got fixed by in #18666

@DanielEScherzer
DanielEScherzer merged commit 3a14ce1 into php:master Jun 4, 2025
@marc-mabe
marc-mabe deleted the patch-1 branch June 4, 2025 06:43
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
The default value of `timestamp_end` is INT32_MAX and not ZEND_LONG_MAX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants