Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext/calendar: Allow easter_date to process years after 2037 on 64bit systems #11862

Merged
merged 1 commit into from Aug 4, 2023

Conversation

Arne1303
Copy link
Contributor

@Arne1303 Arne1303 commented Aug 2, 2023

Until now, easter_date always threw an error if executed with a year after 2037. This was done to prevent an integer overflow with Unix timestamps in the years after 2038 from appearing. (Y2K38 bug)

Since the overflow does not happen with signed 64-bit integers, I added a check to allow easter_date to run on 64bit systems with years after 2037.

@Arne1303 Arne1303 changed the title Allow easter_date to process years after 2037 on 64bit systems ext/calendar Allow easter_date to process years after 2037 on 64bit systems Aug 2, 2023
@Arne1303 Arne1303 changed the title ext/calendar Allow easter_date to process years after 2037 on 64bit systems ext/calendar: Allow easter_date to process years after 2037 on 64bit systems Aug 2, 2023
@Girgias Girgias self-assigned this Aug 2, 2023
ext/calendar/easter.c Outdated Show resolved Hide resolved
@Arne1303 Arne1303 force-pushed the easter_date_64_bit branch 2 times, most recently from 4a15b78 to f2828e1 Compare August 3, 2023 06:15
ext/calendar/easter.c Outdated Show resolved Hide resolved
ext/calendar/easter.c Outdated Show resolved Hide resolved
ext/calendar/easter.c Outdated Show resolved Hide resolved
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Nits, and this also needs an entry in UPGRADING

ext/calendar/easter.c Outdated Show resolved Hide resolved
ext/calendar/easter.c Outdated Show resolved Hide resolved
ext/calendar/easter.c Outdated Show resolved Hide resolved
Added a check to easter_date to allow it to run with years past
2037 when on a 64bit platform.
@Arne1303
Copy link
Contributor Author

Arne1303 commented Aug 4, 2023

@Girgias I fixed the cs and added an entry to UPGRADING! Is there a tool which shows cs violations in this project, or is it more a learning thing to get it right?

@Arne1303
Copy link
Contributor Author

Arne1303 commented Aug 4, 2023

I also submitted PR's to update the English and German docs:

doc_en: php/doc-en#2643
doc_de: php/doc-de#153

@Girgias
Copy link
Member

Girgias commented Aug 4, 2023

@Girgias I fixed the cs and added an entry to UPGRADING! Is there a tool which shows cs violations in this project, or is it more a learning thing to get it right?

No we don't have any such tools, I think some people have tried but it was too difficult to setup :/

Comment on lines +306 to +309
- Calendar
. easter_date() now supports years from 1970 to 2,000,000,000 on 64-bit systems,
previously it only supported years in the range from 1970 to 2037.

Copy link
Member

Choose a reason for hiding this comment

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

We list these in alphabetical order, but that can be fixed as a follow-up for now

@Girgias Girgias merged commit 8ef0e4c into php:master Aug 4, 2023
12 checks passed
jorgsowa pushed a commit to jorgsowa/php-src that referenced this pull request Aug 16, 2023
…1862)

Added a check to easter_date to allow it to run with years past
2037 when on a 64bit platform.
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.

None yet

3 participants