Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40891 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55189 invoked from network); 9 Oct 2008 13:41:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2008 13:41:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=jarismar_silva@adplabs.com.br; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jarismar_silva@adplabs.com.br; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adplabs.com.br designates 201.84.224.135 as permitted sender) X-PHP-List-Original-Sender: jarismar_silva@adplabs.com.br X-Host-Fingerprint: 201.84.224.135 mx.adplabs.com.br Linux 2.6 Received: from [201.84.224.135] ([201.84.224.135:59939] helo=mx.adplabs.com.br) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/96-48736-80A0EE84 for ; Thu, 09 Oct 2008 09:41:28 -0400 Received: from kafe.adplabs.com.br (mail.adplabs.com.br [201.84.224.133]) by mx.adplabs.com.br (Postfix) with ESMTP id 55D754E4184; Thu, 9 Oct 2008 10:41:25 -0300 (BRT) Received: from [10.159.1.169] (jarismar.adplabs.com.br [10.159.1.169]) by kafe.adplabs.com.br (Postfix) with ESMTP id 779BF40C449; Thu, 9 Oct 2008 10:41:19 -0300 (BRT) Message-ID: <48EE0A34.8020903@adplabs.com.br> Date: Thu, 09 Oct 2008 10:42:12 -0300 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Stefan Walk CC: internals@lists.php.net References: <48EDFEED.8080605@adplabs.com.br> <261daaa10810090607h1876200ex1efa43a40cfb24c2@mail.gmail.com> <48EE0387.3040802@adplabs.com.br> <200810091517.37703.et@php.net> In-Reply-To: <200810091517.37703.et@php.net> Content-Type: multipart/alternative; boundary="------------050206080008070008030203" X-ADPLabs-MailScanner-Information: Please contact your ISP for more information X-ADPLabs-MailScanner: Found to be clean X-ADPLabs-MailScanner-From: jarismar_silva@adplabs.com.br X-Spam-Status: No Subject: Re: [PHP-DEV] json_encode ignores protected/private class members From: jarismar_silva@adplabs.com.br (Jarismar Chaves da Silva) --------------050206080008070008030203 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I agree with you. But when using json_encode I believe the developer wants to transfer the complete object state, just like when using serialize. Serialize does see private/protected class members, while json_encode not. Javascript does not have class-accessors so why not convert protected/private to public javascript attributes. Stefan Walk wrote: > On Thursday 09 October 2008 15:13:43 Jarismar Chaves da Silva wrote: > >> Ok, nice solution, but I still don't see why json_encode ignores >> protected/private class members. I mean, why we need this feature. >> > > Because, in theory, it shouldn't even be able to see those members? > > Regards, > Stefan > > -- *Jarismar Chaves da Silva, M.Sc.* *ADP**Labs** Brazil** *jarismar_silva@adplabs.com.br http://www.adp.com --------------050206080008070008030203--