Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25576 invoked from network); 26 Oct 2012 11:47:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2012 11:47:02 -0000 Authentication-Results: pb1.pair.com header.from=tularis@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tularis@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: tularis@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bk0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:53656] helo=mail-bk0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/A3-00401-3387A805 for ; Fri, 26 Oct 2012 07:47:02 -0400 Received: by mail-bk0-f42.google.com with SMTP id j5so1157268bkw.29 for ; Fri, 26 Oct 2012 04:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=aKqDP5y0NJ7nbfsSDmb4ji6xym2rqMh9ZEZnBdFR0H4=; b=wZpCYc0MOCo42dENa4WIgfX7JllYMq80JCIEtBNeLG2vevNOlcDRBBounNoJnhXqJ+ VwKmdpB2I4YlStoqt0+WqwUdp0qYVfh9DCpVng3M8MQ1IpXGmiAasce4AkDSYErRkPY5 zb3gMRxOFIPoaZPRb2ah2sMk3SNTtb6NQV3zy2Z/ncAORV+lZVlovnnsdweerOYQwO17 fRjkFnhQrHHwqWVgMeumCLUgT74Hl9jwh/Nr/tP98R2LUh3sK+17MfU2ZFRXrJ3J8BZs FydhdPUAurV+m8BdAYeDTLHNaJKRF3W7lzokKo8eolbnd0kzhsYWWtABEYZkHDp+9dBs 6A6Q== Received: by 10.204.5.151 with SMTP id 23mr7178686bkv.3.1351252017069; Fri, 26 Oct 2012 04:46:57 -0700 (PDT) Received: from [127.0.0.1] (vhe-540202.sshn.net. [192.87.225.65]) by mx.google.com with ESMTPS id 1sm789920bks.3.2012.10.26.04.46.55 (version=SSLv3 cipher=OTHER); Fri, 26 Oct 2012 04:46:56 -0700 (PDT) Sender: Maciek Sokolewicz Message-ID: <508A7835.2040802@php.net> Date: Fri, 26 Oct 2012 13:47:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Clint Priest CC: PHP Developers Mailing List References: <508A67E6.2000405@zerocue.com> In-Reply-To: <508A67E6.2000405@zerocue.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : Internal Accessor MethodVisibility / Callability From: maciek.sokolewicz@gmail.com (Maciek Sokolewicz) On 26-10-2012 12:37, Clint Priest wrote: > ------------------------------------------------------------------------ > Some people are in favor of the internal functions being generated by an > accessor declaration should be invisible and non-callable directly. > Others are in favor of leaving them visible and callable. > > *Type 1 ( Userland Programmer )** > * > As a userland programmer, someone who cares nothing for "how" php works, > only how their own code works. If they define an accessor they expect to > see an accessor, reflection should reflect that there are accessors and > no other "methods" they did not explicitly define. If they were to > reflect on all of the methods of their class and see a number of > __getHours() they may be confused as to why or where this function came > from. From their perspective, they have defined an accessor and "how" > that accessor works on the inside is of no importance to them and only > seeks to complicate or confuse matters when they are exposed to these > "implementation details" of the php language its-self. If you tried to > set a value such as $obj?abc = 1 through an accessor which could not be > set, you would probably want to see an error like: Warning, cannot set > Class?abc, no setter defined. > > *Type 2 ( Internals Programmer )** > * > As an internals programmer, you want nothing hidden from you. If an > accessor implements special __getHours() methods to work its magic, then > you want to see them, you want to call them directly if you so choose. > In effect you want nothing hidden from you. In this case you probably > don't even want Reflection to reflect accessors as anything different > than specially formatted and called methods on the class. This can be > understandable because you want all information available to you. You > would probably not be confused if you wrote $obj?abc = 1 and got back an > error like "Fatal Error: Class->__setAbc() function does not exist. > > *Unfortunately 80 to 95% of all people who use PHP are of the first type.** > * > Revealing these internal matters to them would only leave them confused, > possibly frustrated and likely asking about it to the internals mailing > list to answer (repeatedly). > ------------------------------------------------------------------------ > > Thoughts? > I personally don't think there's such a huge difference between the two 'groups'. When people in group 1 use reflection to examine their accessors, they should have enough knowledge to understand how accessors are implemented. If we document it well, I don't really see that as a problem. - Tul