Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65043 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71851 invoked from network); 20 Jan 2013 15:39:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2013 15:39:19 -0000 Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.181 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 74.125.82.181 mail-we0-f181.google.com Received: from [74.125.82.181] ([74.125.82.181:39658] helo=mail-we0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/A3-25745-6AF0CF05 for ; Sun, 20 Jan 2013 10:39:18 -0500 Received: by mail-we0-f181.google.com with SMTP id u7so1225439wey.12 for ; Sun, 20 Jan 2013 07:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=oFKTMJevUirqX8vNJGNQ6k0uHtqXTjU+eWTiAVQM1SU=; b=Jg0pnYOI0vj+J9PpmYv3p5DdTnmHZOT8CEfa8+6zZ8FIBL7b8E+Newn7TUJwoVy7FF cFBYKjpyaetLul2pb7BhlnFx7lboT0UfDz4bAdvkg5ys6rKb9Y5d7O8/GPa6GTKV6u57 9+SpTm1b5AfMPNy1dEX8q2iy4Sl3AU6BUqMxjVo5enUlUQ/Lps+fR1++ja3hcDe5/4F+ rud2IDZCebxLGkQ4yWXFZ7KOm9O8tsMScR0PlqPZLIIv4xs1xL7v33KgiMZJFiFEubxh PYkapQmSilHj91YANJYD2xm5taowfS2rcRPpCqpNbDI/ImdehxqEYB0SJZNuIT462Yrl IPFA== MIME-Version: 1.0 X-Received: by 10.194.172.228 with SMTP id bf4mr22383271wjc.38.1358696354913; Sun, 20 Jan 2013 07:39:14 -0800 (PST) Received: by 10.227.43.19 with HTTP; Sun, 20 Jan 2013 07:39:14 -0800 (PST) In-Reply-To: <50FC0DD5.8000206@zerocue.com> References: <50F840F4.7080704@zerocue.com> <50F87A23.60808@mrclay.org> <50F8A88D.1000409@zerocue.com> <50FC0DD5.8000206@zerocue.com> Date: Sun, 20 Jan 2013 10:39:14 -0500 Message-ID: To: Clint Priest Cc: PHP Developers Mailing List Content-Type: multipart/alternative; boundary=089e013c6c12979d8c04d3ba25f5 Subject: Re: [PHP-DEV] [VOTE] Property Accessors for 5.5 From: theanomaly.is@gmail.com (Sherif Ramadan) --089e013c6c12979d8c04d3ba25f5 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jan 20, 2013 at 10:31 AM, Clint Priest wrote: > > On 1/20/2013 7:35 AM, Sherif Ramadan wrote: > > Now $surface shows us the following from var_dump.... > > object(surface)#1 (3) { > ["area"]=> > NULL > ["width"]=> > int(4) > ["height"]=> > int(2) > } > > Sounds like a reasonable approach to me... var_dump() > > 1) Should not invoke the getters.. > I can agree this since the side effects could be unpredictable (as in the case of an accessor implementing an actual method rather than dealing with with any values -- the performance loss is unjustified) > 2) Should indicate that they are property accessors (perhaps not even show > the underlying guarded property?) > That is a sensible approach to me. > > Possibly: > > object(surface)#1 (3) { > ["area":accessor]=> > NULL > ["width":accessor]=> > int(4) > ["height":accessor]=> > int(2) > } > > This could easily be changed if nobody had any further disagreements with > this? > > Only issue I could see would be existing code that may parse var_dump() > might break if it wasn't written to accept something other that > private/protected... > I think that one should rely on serialize or json_* serialization methods or parsing data structures as opposed to var_dump output, since var_dump doesn't always provide parseable output. Look at the output of DateTime objects from var_dump or DateInterval objects, which have changed a bit over 5.2 -> 5.3 and other objects like DOMDocument, which at one point did not have any meaningful var_dump output at all. > > > -- > -Clint > --089e013c6c12979d8c04d3ba25f5--