Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40897 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63641 invoked from network); 9 Oct 2008 14:01:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2008 14:01:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=dave@dmi.me.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dave@dmi.me.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain dmi.me.uk designates 213.171.205.116 as permitted sender) X-PHP-List-Original-Sender: dave@dmi.me.uk X-Host-Fingerprint: 213.171.205.116 unknown Received: from [213.171.205.116] ([213.171.205.116:59698] helo=scaramanga.siterage.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/88-48736-6CE0EE84 for ; Thu, 09 Oct 2008 10:01:48 -0400 Received: from localhost (scaramanga.siterage.net [127.0.0.1]) by localhost.akadia.com (SiteRage Mail Server) with ESMTP id 6BB46CECD; Thu, 9 Oct 2008 15:00:31 +0100 (BST) X-Spam-Flag: NO X-Spam-Score: -3.85 X-Spam-Level: X-Spam-Status: No, score=-3.85 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.548, BAYES_00=-2.599, DNS_FROM_SECURITYSAGE=0.001] Received: from scaramanga.siterage.net ([127.0.0.1]) by localhost (scaramanga.siterage.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hU0AthFOAhzU; Thu, 9 Oct 2008 15:00:30 +0100 (BST) Received: from [192.168.201.2] (unknown [195.72.173.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by scaramanga.siterage.net (SiteRage Mail Server) with ESMTPSA id 4CE93CEBF; Thu, 9 Oct 2008 15:00:30 +0100 (BST) Message-ID: <48EE0E7D.8010909@dmi.me.uk> Date: Thu, 09 Oct 2008 15:00:29 +0100 User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: Ron Rademaker CC: Stefan Walk , internals@lists.php.net References: <48EDFEED.8080605@adplabs.com.br> <200810091551.23205.et@php.net> <48EE0DEA.6030601@connectholland.nl> In-Reply-To: <48EE0DEA.6030601@connectholland.nl> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] json_encode ignores protected/private class members From: dave@dmi.me.uk (Dave Ingram) Ron Rademaker wrote: > Stefan Walk wrote: >> That would be unclean. If it's implemented in some way, json_encode >> should look for the implementation of some interface (JSONEncodable >> or something) providing encoding/decoding methods (similar to >> __sleep/__wakeup). > Looking at our current JSON implementations, such an interface would > be very very welcome. If at all possible something like JSONDecodable > would be great as well, for restoring class members from json. I'm thinking about getting involved with some PHP internals, so this might be as good a place to start as any, unless someone else is particularly interested or motivated. Having said that, I had first planned to make some minor changes to the apache2 SAPI to solve a long-requested feature. I haven't yet looked into why the Apache hasn't been implemented yet though, so I didn't want to propose it yet. Dave