# DateTimeZone Serialize/Unserialize

- Thread: https://externals.io/message/63236
- Original archive: https://news-web.php.net/php.internals/63236
- Started by Lonny Kapelushnik on 2012-09-25T12:02:43+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #63236 — Lonny Kapelushnik — 2012-09-25T12:02:43+00:00

URL: https://externals.io/message/63236#63236

Morning!

I was creating a patch to allow serialize/unserialize of the DateTimeZone
object. When running `make test` I found that we already have a test for
the serialize/unserialize of DateTimeZone. The test checks that we are
_not_ able to serialize/unserialize the DateTimeZone object:
https://github.com/php/php-src/blob/PHP-5.4/ext/date/tests/DateTimeZone_serialize.phpt

Is the test correct or do we want to be able to serialize/unserialize
DateTimeZone? If the test is correct, why do we not want to be able to
serialize/unserialize DateTimeZone objects?

Thank you!

-- 
Lonny Kapelushnik
http://lonnylot.com
(732) 807-5509

---

## #63238 — Stas Malyshev — 2012-09-25T20:07:50+00:00

URL: https://externals.io/message/63236#63238 · In reply to: #63236

Hi!

> object. When running `make test` I found that we already have a test for
> the serialize/unserialize of DateTimeZone. The test checks that we are
> _not_ able to serialize/unserialize the DateTimeZone object:
> https://github.com/php/php-src/blob/PHP-5.4/ext/date/tests/DateTimeZone_serialize.phpt
> 
> Is the test correct or do we want to be able to serialize/unserialize
> DateTimeZone? If the test is correct, why do we not want to be able to
> serialize/unserialize DateTimeZone objects?

We want it to be serializable. This test probably should have been XFAIL
test instead, but in general it's kind of hard to test for code that
doesn't work, so I guess it was instead made to test the current state
of the code.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
