You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it would be difficult, but what is the use case? I assume that IntlTimezone is most often used with IntlCalendar and IntlDateFormatter, but neither of these properly supports (un)serialization. Other classes of the intl extension might exhibit the same behavior.
Activity
iluuu1994 commentedon Jan 13, 2022
It doesn't look like
IntlTimeZonesupports serialization.https://3v4l.org/jnXqP#v8.1.1
But we could throw an error or at least emit some warning.
drjayvee commentedon Jan 13, 2022
Would it be difficult to implement serialization? Or do you worry about backwards compatibility?
iluuu1994 commentedon Jan 13, 2022
@drjayvee I know nothing about
intlso I'm not sure. Compatibility shouldn't be a concern.cmb69 commentedon Jan 15, 2022
I don't think it would be difficult, but what is the use case? I assume that
IntlTimezoneis most often used withIntlCalendarandIntlDateFormatter, but neither of these properly supports (un)serialization. Other classes of the intl extension might exhibit the same behavior.drjayvee commentedon Jan 17, 2022
I was under the admittedly naive assumption that every class supports serialization, unless it's especially tricky.
Our particular use case is:
And then cache the user's configuration in their session, memory cache, or elsewhere.
The simple yet awkward workaround is
cmb69 commentedon Jan 17, 2022
Okay, for this case being able to (un)serialize
IntlTimeZoneobjects would make sense.Note, though, that a lot of internal classes don't support (un)serialization.
Fix phpGH-7939: Cannot unserialize IntlTimeZone objects
cmb69 commentedon Feb 17, 2022
Serialization of these objects will be disallowed as of PHP 8.2.0. PRs to properly support (un)serialization (of individual classes) are welcome!