Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40895 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60817 invoked from network); 9 Oct 2008 13:56:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2008 13:56:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=ron@connectholland.nl; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ron@connectholland.nl; sender-id=unknown Received-SPF: error (pb1.pair.com: domain connectholland.nl from 81.4.92.194 cause and error) X-PHP-List-Original-Sender: ron@connectholland.nl X-Host-Fingerprint: 81.4.92.194 seoul.virtualbuilding.nl Linux 2.5 (sometimes 2.4) (4) Received: from [81.4.92.194] ([81.4.92.194:38243] helo=seoul.virtualbuilding.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/F7-48736-08D0EE84 for ; Thu, 09 Oct 2008 09:56:16 -0400 Received: from localhost (localhost [127.0.0.1]) by seoul.virtualbuilding.nl (Postfix) with ESMTP id CFA345A13D4; Thu, 9 Oct 2008 15:52:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at seoul.virtualbuilding.nl Received: from seoul.virtualbuilding.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J0dNs+DGmydR; Thu, 9 Oct 2008 15:52:28 +0200 (CEST) Received: from [10.123.123.7] (82-204-104-172.fttx.bbeyond.nl [82.204.104.172]) by seoul.virtualbuilding.nl (Postfix) with ESMTPSA id 645AD5A13DB; Thu, 9 Oct 2008 15:52:28 +0200 (CEST) Message-ID: <48EE0DEA.6030601@connectholland.nl> Date: Thu, 09 Oct 2008 15:58:02 +0200 User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Stefan Walk CC: internals@lists.php.net References: <48EDFEED.8080605@adplabs.com.br> <200810091551.23205.et@php.net> In-Reply-To: <200810091551.23205.et@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] json_encode ignores protected/private class members From: ron@connectholland.nl (Ron Rademaker) 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. Ron