Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47073 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23061 invoked from network); 1 Mar 2010 17:11:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2010 17:11:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 97.107.131.220 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 97.107.131.220 whisky.macvicar.net Linux 2.6 Received: from [97.107.131.220] ([97.107.131.220:58083] helo=whisky.macvicar.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/42-16552-E25FB8B4 for ; Mon, 01 Mar 2010 12:11:10 -0500 Received: from [10.43.182.23] (unknown [166.205.139.189]) by whisky.macvicar.net (Postfix) with ESMTP id 091B246A51; Mon, 1 Mar 2010 12:11:05 -0500 (EST) References: <4B8A97AF.3060608@seld.be> <4bcbf4711002281200u409f041dm330a328eb546e039@mail.gmail.com> <1199A1E8-7663-4A1F-ACEB-1D2B77569BAE@gmail.com> <4B8B92A6.4060100@seld.be> Message-ID: To: Jordi Boggiano In-Reply-To: <4B8B92A6.4060100@seld.be> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Date: Mon, 1 Mar 2010 09:11:13 -0800 Cc: Tjerk Meesters , Herman Radtke , "internals@lists.php.net" Subject: Re: [PHP-DEV] Unserialize is broken From: scott@macvicar.net (Scott MacVicar) Java has a transient keyword to skip serialising a property and I have a patch against 5.3 on http://whisky.macvicar.net/patches/ It might make it in to 5.4/6/next once I get some more free time. Scott On 1 Mar 2010, at 02:10, Jordi Boggiano wrote: > On 01.03.2010 10:31, Tjerk Meesters wrote: >> 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 ;-) > > Honestly I personally don't care, it won't happen to me again, I > know it > now, but I want it to be fixed for the benefit of others. Sure it's a > rare case, but if you're gonna pretend it's ok that objects have ghost > properties set to them that are unreadable, I guess there is no > point in > discussing this further. > > Should I btw remind you that the following results in a Fatal error: > Cannot redeclare Test::$foo ? > > class Test { > protected $foo; > public $foo; > } > > So it's illegal, but let's do it anyway because in php core it's funny > to do weird stuff that doesn't make any sense? > > And in any case json_encode doesn't work the same at all since it > doesn't encode protected properties, and doesn't store the object > type, > so it'd be much more work. > > Cheers, > Jordi >