Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61432 invoked from network); 20 Jan 2013 13:52:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2013 13:52:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.174 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.212.174 mail-wi0-f174.google.com Received: from [209.85.212.174] ([209.85.212.174:50887] helo=mail-wi0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/42-25745-7A6FBF05 for ; Sun, 20 Jan 2013 08:52:40 -0500 Received: by mail-wi0-f174.google.com with SMTP id hq4so6433485wib.7 for ; Sun, 20 Jan 2013 05:52:36 -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=XUrmH4wQPB1e6d5STUAR3Rg7s526RyTUyDiaHkagMVU=; b=WZTuDoCSE1b1yXpJDHljWRusW3w3HPQTykAvKNas65MrLdTX+UTYFIS27q6ffrpJIK eYMx9IuupZPZIMIO7PN62GOQRLklexaYN6hlA2pKCNPW+a5xkyDfq+VlkDCFDK60pbr5 pI3HgsIBwYP0M9Tp/ytDoj2ds+EDkwdLa/C0bu9L28Xh8pyzF6AS30JcxtxhzpQGBMv3 bvnfuCMdNqLHe67PmqrLgtctEas7NHAfwHx/yz6n+Oz5RE9BON/7C/9PUt/PmM5f6Pp4 fO/3+UcwJK+v7wPRjlqTkn7UddSgikv4Gp+TPnulPWQzA2hoMLvWJXZ3WQCfG7Ubrn0A TNgg== MIME-Version: 1.0 X-Received: by 10.180.86.36 with SMTP id m4mr11213719wiz.5.1358689956894; Sun, 20 Jan 2013 05:52:36 -0800 (PST) Received: by 10.227.43.19 with HTTP; Sun, 20 Jan 2013 05:52:36 -0800 (PST) In-Reply-To: References: <50F840F4.7080704@zerocue.com> <50F87A23.60808@mrclay.org> <50F8A88D.1000409@zerocue.com> Date: Sun, 20 Jan 2013 08:52:36 -0500 Message-ID: To: Gustavo Lopes Cc: Nikita Popov , Clint Priest , Steve Clay , PHP Internals Content-Type: multipart/alternative; boundary=f46d0442859c3d976f04d3b8a870 Subject: Re: [PHP-DEV] [VOTE] Property Accessors for 5.5 From: theanomaly.is@gmail.com (Sherif Ramadan) --f46d0442859c3d976f04d3b8a870 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jan 20, 2013 at 8:45 AM, Gustavo Lopes wrote: > On Sun, 20 Jan 2013 14:35:14 +0100, Sherif Ramadan < > theanomaly.is@gmail.com> wrote: > >> What I'm saying is this kind of behavior needs far more serious reasoning >> than the very naive assesment you're making above. >> >> I mean that with all due respect. Just wondering if there is another take >> on this from anyone else? >> >> > I think the current behavior is most appropriate one for var_dump() (and > array casts/get_object_vars()). It's the same behavior as if you had > manually defined getXXX() methods or used __get(). > It's actually not the same behavior at all. __get can only work on inaccessible properties. So I would not see NULL there in the object and then get a value in the instance property. > > If you start marking function calls, you get new problems like handling > getters that throw exceptions or have side effects ("the code behaves > differently when add a var_dump()?!"). I'm not suggesting the getters should be invoked from afar. I'm just suggesting some additional means of informing the user of the existence of that getter to distinguish it from the property in the output of var_dump. So for example, in var_dump, you can get ["property":protected] => ... when the property has a visibility outside of the current context. It might be helpful to provide some similar behavior for accessors with null initialized values, but have getters available to the caller? Just a thought. > > > -- > Gustavo Lopes > --f46d0442859c3d976f04d3b8a870--