Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65119 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15733 invoked from network); 23 Jan 2013 19:01:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2013 19:01:15 -0000 Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.41 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.212.41 mail-vb0-f41.google.com Received: from [209.85.212.41] ([209.85.212.41:43520] helo=mail-vb0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/E1-30997-97330015 for ; Wed, 23 Jan 2013 14:01:14 -0500 Received: by mail-vb0-f41.google.com with SMTP id l22so4022501vbn.28 for ; Wed, 23 Jan 2013 11:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=OaEGS/eDuZCu85zPDj9oQZjZQsUrioH1N24mtJlUIoo=; b=VATVWNhpOAYweAe0jFN5K7BxElVW8/YrAGvK+amAbxlaCKAjNPDJt2crsR0zHcH0IB vLxeC6lKEU+J6RNBTk9LfX4JysunlGcxTgzxzM+0Tmb83p77Y4Ipi9GydMs+sUg+EnSd e7co/hpEnUQMpRucMhoIyglsAnoCCE4z9zLlEFg6QM1lnH+2iMgoRttMcYCpKIVqBPX2 iB/Xu1VxY5MKsRq+oUXO3DNBIuuenw/EgR+A1UWEqthPhFnqSYESlCHm+94as1AN54f6 ld9Ln8pafuyH5cLX8j7Xa1H/387CgSBLEIvalyUSpxbupmtwJ/cBp2XC7vVb5SHBEi7U u0fQ== X-Received: by 10.220.219.145 with SMTP id hu17mr2540683vcb.52.1358967671374; Wed, 23 Jan 2013 11:01:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.118.52 with HTTP; Wed, 23 Jan 2013 11:00:51 -0800 (PST) In-Reply-To: References: <50F840F4.7080704@zerocue.com> <50FE7579.1010409@zerocue.com> <5100172C.8040903@zerocue.com> Date: Wed, 23 Jan 2013 20:00:51 +0100 Message-ID: To: Sherif Ramadan Cc: Clint Priest , Anthony Ferrara , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=14dae9cfce9450425e04d3f951b5 Subject: Re: [PHP-DEV] [VOTE] Property Accessors for 5.5 From: ocramius@gmail.com (Marco Pivetta) --14dae9cfce9450425e04d3f951b5 Content-Type: text/plain; charset=UTF-8 On 23 January 2013 19:53, Sherif Ramadan wrote: > > They're not shown because they don't exist. Thus no confusion about whether > this is a property or not. If it's a property we can see it in > var_dump($obj). If it's magic you can only see it in > var_dump($obj->property). With accessors you see both, but you are seeing > (potentially) two different values. For me, that's the "misleading" part. > > I agree that there are benefits here, but I can't agree that the benefits > outweigh the draw backs for me, which are all the added complexity. Like > Anthony said it's pretty much just coming down to custom scoping > getters/setters at the end of the day. > > > Actually, having the properties shown even if virtual allows us to access them in a reflection-ish manner without doing dangerous assumptions like "does the setter/getter exist"? The fact that the property is virtual is very useful, even though in dumping it doesn't show any value. I don't see any radical difference in debugging or ease of use in general. Actually, doing the same things with magic getters/setters would probably imply having to think more about the trace we want to follow when analyzing our bugs. It is just a matter of being aware of new setter/getters (that are anyway in our trace). Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --14dae9cfce9450425e04d3f951b5--