Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixes GH-8152: add __serialise and __unserialise methods to DateInterval #8459

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

Merged

Conversation

derickr
Copy link
Member

@derickr derickr commented Apr 29, 2022

This PR adds support for __serialize and __unserialize to DateInterval.

Unlike the changes to DateTime, there are some behavioural changes:

  • The exposed internal implementation details for "relative intervals" (such as next weekday) no longer express as (fake) properties. But note that you couldn't do anything with these properties, and upon the original deserialisation, these were ignored (and not warned against). If present upon deserialisation, they will continue to just be ignored as to not break existing serialisation strings.
  • For situations where exposed internal implementation details were not-NIL, they've been replaced with a new property (date_string), and with the flag from_string set to true.
  • This now allows for correct serialisation/unserialisation of all DateInterval objects

@derickr derickr requested review from arnaud-lb and Girgias April 29, 2022 09:39
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.

Other than the code style nit for tests, LGTM.

Might want an entry in UPGRADING clarifying the change in behaviour?

@Girgias
Copy link
Member

Girgias commented Apr 29, 2022

Well seems there are some GC issues on Mac, and segfault on FreeBSD

@derickr derickr self-assigned this Apr 29, 2022
@derickr
Copy link
Member Author

derickr commented Apr 29, 2022

@Girgias Looks OK now with that latest commit(s). I used Z_STR and not Z_STR_COPY to copy one of my strings. And the other one was just because I didn't update 32bit tests.

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.

3 participants