Skip to content

Deprecate DATE_RET_* constants (related to date_sunrise/date_sunset) #7248

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

Closed
wants to merge 1 commit into from

Conversation

Ayesh
Copy link
Member

@Ayesh Ayesh commented Jul 16, 2021

Related: 5bb83b3
date_sunrise and date_sunset functions are deprecated in PHP 8.1, along with the ini settings.

Both date_sunrise and date_sunset functions accept a parameter to specify the format of the returned time. They accept one of the three following constants:

  • SUNFUNCS_RET_STRING
  • SUNFUNCS_RET_DOUBLE
  • SUNFUNCS_RET_TIMESTAMP

These constants are only used with date_sunrise and date_sunset functions, and are not used anywhere. This deprecates the three constants.

@Ayesh Ayesh force-pushed the php81-depr/date_sun_consts branch from 059d530 to d08f17f Compare July 16, 2021 11:18
@Girgias Girgias requested a review from derickr January 4, 2023 20:10
@jorgsowa
Copy link
Contributor

Hey @Ayesh! I like your change. It's useful.

However, base on other PRs I think your change requires RFC process as for every deprecation. Also, you could change your PR to ready state, because other reviewers may think that's still WIP.

@derickr
Copy link
Member

derickr commented Mar 18, 2024

This now also conflicts, and AFAIK, it is going to be part of the 8.4 deprecations RFC.

@Ayesh Ayesh force-pushed the php81-depr/date_sun_consts branch from d08f17f to 0bafa23 Compare March 18, 2024 17:47
@Ayesh Ayesh marked this pull request as ready for review March 18, 2024 17:47
@Ayesh Ayesh requested a review from kocsismate as a code owner March 18, 2024 17:47
@Ayesh Ayesh force-pushed the php81-depr/date_sun_consts branch from 0bafa23 to ce479c5 Compare March 18, 2024 17:48
@Ayesh
Copy link
Member Author

Ayesh commented Mar 18, 2024

Thank you for taking another look. I submitted this for PHP 8.1 when we were deprecating date_sunrise/sunset functions. I somehow didn't create an RFC, and it was not me who proposed to add this to PHP 8.4 deprecations, but I'm glad it made to this list.

I reworked the PR to deprecate the same three constants for PHP 8.4.

Deprecates constants:
 - SUNFUNCS_RET_STRING
 - SUNFUNCS_RET_TIMESTAMP
 - SUNFUNCS_RET_DOUBLE

They are only used for parameters of date_sun_info() function, which is deprecated
since PHP 8.1
@Ayesh Ayesh force-pushed the php81-depr/date_sun_consts branch from ce479c5 to d4d4a4a Compare March 18, 2024 17:52
@jorgsowa
Copy link
Contributor

Hey @Ayesh,

I have added this change to RFC and created a new PR (#12978) as there was no activity in the current one. I hope it's not a problem.

@Ayesh
Copy link
Member Author

Ayesh commented Mar 19, 2024

Absolutely! I will close this PR for the new one.

@Ayesh Ayesh closed this Mar 19, 2024
@Ayesh Ayesh deleted the php81-depr/date_sun_consts branch March 19, 2024 03:36
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