Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47066 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32987 invoked from network); 1 Mar 2010 09:33:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2010 09:33:27 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:36406] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/D1-16552-6E98B8B4 for ; Mon, 01 Mar 2010 04:33:27 -0500 Received: by gyg13 with SMTP id 13so463096gyg.29 for ; Mon, 01 Mar 2010 01:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; bh=LgrEE0bqbf2/391V2qXj2vdVw4yxAgITDSlIgceZDao=; b=hikv+UTn8TxzPeDHWSH/kmPOxUMnJBJCrmLr6w2wwQYYBUBp/s8scstD9lyLrijENA oN8LpLW5M6MsL/kAU7GU07dvAKrUv7aP0HkBEuCr0Dqozzam/45X3VQ0qh4xyJGG/R5q ecJGG8o5OJth3//V3C5FXtngNprfWJ7h+fLMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc; b=AngSVC8uSW60aWlsGSZUTpMgpLFomEVcf+h9MAF75Zq3DtbMltBxXBseb+Vjeth59Z G4JmDXxhNNpNsFTx4w3OUQ78VYjAg/mezRCwkbCHDq88sPajJjwvTrFPDB0FxDJT4E9V OpT5RHId638q7ZbvWdbqAgiGjSjPTb8sNYktU= Received: by 10.151.89.20 with SMTP id r20mr2171775ybl.311.1267436004077; Mon, 01 Mar 2010 01:33:24 -0800 (PST) Received: from ?192.168.1.105? (bb121-6-104-14.singnet.com.sg [121.6.104.14]) by mx.google.com with ESMTPS id 4sm1111995ywd.43.2010.03.01.01.33.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 01 Mar 2010 01:33:22 -0800 (PST) References: <4B8A97AF.3060608@seld.be> <4bcbf4711002281200u409f041dm330a328eb546e039@mail.gmail.com> Message-ID: <1199A1E8-7663-4A1F-ACEB-1D2B77569BAE@gmail.com> To: Jordi Boggiano In-Reply-To: <4bcbf4711002281200u409f041dm330a328eb546e039@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPod Mail (7D11) Mime-Version: 1.0 (iPod Mail 7D11) Date: Mon, 1 Mar 2010 17:31:54 +0800 Cc: Herman Radtke , "internals@lists.php.net" Subject: Re: [PHP-DEV] Unserialize is broken From: tjerk.meesters@gmail.com (Tjerk Meesters) Hi, If visibility is an issue why not just use json_enode/decode for this case then?it doesn't seem like a typical enough problem to be solved low-level and json seems fast enough for the job ;-) On 01-Mar-2010, at 4:00, Jordi Boggiano wrote: > On Sun, Feb 28, 2010 at 8:03 PM, Herman Radtke > wrote: >>> Imo unserialize should check, when applying public or protected >>> values, >>> if either exists on the object, and apply it to the one that exists. >>> Sure it's gonna cost some performance, but at least changing the >>> prototype of your class while stuff is running isn't going to kill >>> your >>> code anymore. >> >> This seems like a corner case and one that a conversion script should >> handle. Considering that serialize and unserialize are called for >> every single web-request, degrading the performance of unserialize is >> not something that should be done lightly. > > Well.. the problem is you can't use __wakeup() for it, because at that > point it's too late to read the values, it could work if you got the > properties as an array or something as __wakeup($data), but that's not > the case. So the only approach would be to edit the scripts manually, > and that's the last thing I want to do honestly, in the playing with > fire category serialized strings are pretty high ranked. > > Patching __wakeup handling could be a non-costly option I suppose, but > that's just another hack on top of the hackish hacks, and I don't want > to be the cause of it, so if unserialize can't be fixed I'd rather > have nothing. > > Cheers, > Jordi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >