Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54724 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65777 invoked from network); 19 Aug 2011 12:31:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2011 12:31:51 -0000 Authentication-Results: pb1.pair.com header.from=arraypad@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=arraypad@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: arraypad@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:50166] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/DA-11562-5B75E4E4 for ; Fri, 19 Aug 2011 08:31:50 -0400 Received: by vxh24 with SMTP id 24so2778708vxh.29 for ; Fri, 19 Aug 2011 05:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=XpAPFjmhgqb9ez6wfQiyIY+IWR9P7zqeJO3LnRX5Zwk=; b=Pk17LVulGw/ly00PM/nYWwygDIVZSA+J6EXO+sYx81zZQzL5GRJWJB+lZ9GTSTZYyt bJpQIQ4/qBjXo7Sv7h47sLq/iDL+2zA/Y1YRnMugwhhviLYI2otgTbcPeDJ7IGB2luEv x6+xQrFrLM8XvnYLdnkb87oHUE1x8MAarsnaY= MIME-Version: 1.0 Received: by 10.52.21.204 with SMTP id x12mr2013176vde.181.1313757106715; Fri, 19 Aug 2011 05:31:46 -0700 (PDT) Received: by 10.52.187.167 with HTTP; Fri, 19 Aug 2011 05:31:46 -0700 (PDT) In-Reply-To: References: <4E4E48F6.8010107@php.net> Date: Fri, 19 Aug 2011 13:31:46 +0100 Message-ID: To: Ferenc Kovacs Cc: Paul Dragoonis , Pierre Joye , Sebastian Bergmann , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Activation of IGBinary serialization extension in 5.4 by default From: arraypad@gmail.com (Arpad Ray) On Fri, Aug 19, 2011 at 1:04 PM, Ferenc Kovacs wrote: > this could still cause problems, as pointed out before (when you > change your handler, or when you pass serialized data between > different php installs, etc.), so I really like what Kiall Mac Innes > suggested: prefix the data with the serializer identifier. > if it is missing, =A0then it was serialized with the old method, if it > is present, the appropriate method should be used, if the serializer > ident is there but unknown, then exit with a fatal error telling the > user that the custom handler is missing. This came up when we discussing changing the default session serialization format a while ago. A prefix is a nice idea but care would have to be taken not to collide with any of the bytes which are valid for the current format to start with. Might be more of a curiosity than anything useful, but IIRC unserialize() currently ignores everything after the end of the data. > the downside would be that if you want to serialize/unserialize the > data outside of php, your implementation should take care of this > prefix. > just a wild idea, but maybe useful: > instead of creating a prefix, we could serialize the passed data with > the given(php, igbinary, etc.) handler, then wrap the whole stuff into > an array which holds the name of the used handler and the serialized > data, and serialize this array with the old(php) serialize method. > this way the datablob would be always a valid serialized string, and > would be easier to get the serialize method than with the prefixing. If my old app couldn't read some newly serialized string, I'd rather it failed hard than apparently succeed but have the wrong data. Regards, Arpad