Re: Fix for bug #63437
On Sat, 09 Mar 2013 21:36:41 +0100, Derick Rethans <[email protected]> wrote:
On Tue, 5 Mar 2013, Anatol Belski wrote:
Serializing this as a base64 encoded variant of some binary data is not
a good thing. If you want to serialize, it needs to output the same
thigns that allow users to create the period or interval.
I would agree in principle, but, as I explained before, there is a problem. The DatePeriod class has 64-bit integers in its internal structure. The PHP integer type cannot (in general) represent that data. So the general method of getting the object data via get_properties and serializing (and then using __set_state to convert the array back) does not work unless you represent those 64-bit integers with some non-integer type and do the conversions.
I also don't think this would work for Big Endian vs Little Endian
either.
It does; the integers are converted to network order before being stored, so you can share the serialized data between machines with different endianness.
--
Gustavo Lopes
Thread (15 messages)