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

Unserialize from Carbon v2 objects #3015

Open
kylekatarnls opened this issue May 1, 2024 · 1 comment
Open

Unserialize from Carbon v2 objects #3015

kylekatarnls opened this issue May 1, 2024 · 1 comment
Assignees
Milestone

Comments

@kylekatarnls
Copy link
Collaborator

Related to #3002

Running with Carbon v2:

echo serialize(Carbon::parse('-2 months')->diffAsCarbonInterval());

We obtain:

O:21:"Carbon\CarbonInterval":22:{s:1:"y";i:0;s:1:"m";i:2;s:1:"d";i:0;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";d:5.4E-5;s:6:"invert";i:0;s:4:"days";b:0;s:11:"from_string";b:0;s:9:" * tzName";N;s:7:" * step";N;s:22:" * localMonthsOverflow";N;s:21:" * localYearsOverflow";N;s:25:" * localStrictModeEnabled";N;s:24:" * localHumanDiffOptions";N;s:22:" * localToStringFormat";N;s:18:" * localSerializer";N;s:14:" * localMacros";N;s:21:" * localGenericMacros";N;s:22:" * localFormatFunction";N;s:18:" * localTranslator";N;}

Then when running in Carbon v3:

unserialize($string); // $string being the serialized data above

It chokes on tzName (which has been renamed timezoneSetting)

Carbon version: 3.3.1

PHP version: 8.3

@kylekatarnls
Copy link
Collaborator Author

There are similar issues with CarbonPeriod unserialization. However Carbon, CarbonImmutable and CarbonTimeZone are fine.

@kylekatarnls kylekatarnls modified the milestones: 3.4.0, 3.5.0 May 25, 2024
@kylekatarnls kylekatarnls modified the milestones: 3.5.0, 3.6.0 Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant