Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66569 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88605 invoked from network); 9 Mar 2013 20:57:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2013 20:57:56 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.21 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.21 smtp1.ist.utl.pt Linux 2.6 Received: from [193.136.128.21] ([193.136.128.21:49414] helo=smtp1.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/B0-19169-252AB315 for ; Sat, 09 Mar 2013 15:57:55 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id E75D970003DC; Sat, 9 Mar 2013 20:57:51 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp1.ist.utl.pt ([127.0.0.1]) by localhost (smtp1.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id Hrxt6AJZCL09; Sat, 9 Mar 2013 20:57:51 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp1.ist.utl.pt (Postfix) with ESMTP id A3DD370003DB; Sat, 9 Mar 2013 20:57:51 +0000 (WET) Received: from damnation.nl.lo.geleia.net (unknown [IPv6:2001:470:94a2:4:222:fbff:fe79:e0f0]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 5853F200D083; Sat, 9 Mar 2013 20:57:50 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Anatol Belski" , "Derick Rethans" Cc: internals@lists.php.net References: Date: Sat, 09 Mar 2013 21:57:46 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: User-Agent: Opera Mail/12.14 (Linux) Subject: Re: [PHP-DEV] Fix for bug #63437 From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Sat, 09 Mar 2013 21:36:41 +0100, Derick Rethans wrote: > On Tue, 5 Mar 2013, Anatol Belski wrote: > >> I've reworked the patch from >> http://nebm.ist.utl.pt/~glopes/misc/date_period_interval_ser.diff >> (mentioned by tony2001) for bug #63437, that seems to fix the issue. >> That patch was ported back to 5.3 and adapted to the current 5.4+. >> Both variants are posted to the ticket. > > 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