Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63334 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1917 invoked from network); 11 Oct 2012 02:18:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Oct 2012 02:18:53 -0000 Authentication-Results: pb1.pair.com header.from=tbprogrammer@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tbprogrammer@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.42 as permitted sender) X-PHP-List-Original-Sender: tbprogrammer@gmail.com X-Host-Fingerprint: 209.85.219.42 mail-oa0-f42.google.com Received: from [209.85.219.42] ([209.85.219.42:47197] helo=mail-oa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/00-01707-C8C26705 for ; Wed, 10 Oct 2012 22:18:52 -0400 Received: by mail-oa0-f42.google.com with SMTP id j1so1403553oag.29 for ; Wed, 10 Oct 2012 19:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ii++YXeoG2H3s7Jdl8GsftGK/vflc6GDGeJoNYeeOUU=; b=jxIht5U3Rbkc2p6URrCqEnivuPs0eeTG364g0hJFnLeKsJIQJoH5MgV8/HvJ8OLd3r 2AckYpKYM4kRvwXv3/Sa6Hu6Tt78Yg8H/VBAIQK+IrHCl+CuiNmgRTCmsxNpqV693xVA P/6BZprCCFsAqILLqy6By1n0mUSdL48Iji54Ob42qPaA7lUqMgq6dT+kCk2YFl89Bw5b EJZKWlePFmh8LcfTFbY6C7lc2dXSmWlc31fe1rV7zDnnoDZ87ueVkErGZ4JdaZFGrOAH 2pqTQNZUY7Iv8aLtc2+ybhtN/qnEofAD3CMXfhF8ITAwK0WTwJQZeQ/nJ/DgbXPSJ+Yc YE3w== Received: by 10.182.174.66 with SMTP id bq2mr7385013obc.101.1349921929443; Wed, 10 Oct 2012 19:18:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.11.170 with HTTP; Wed, 10 Oct 2012 19:18:29 -0700 (PDT) In-Reply-To: <9570D903A3BECE4092E924C2985CE485612B4EFE@MBX202.domain.local> References: <9570D903A3BECE4092E924C2985CE485612B3B48@MBX202.domain.local> <5073328D.5000002@gmail.com> <50735165.8010703@aaronholmes.net> <9570D903A3BECE4092E924C2985CE485612B4353@MBX202.domain.local> <760ab4f994a78a846cf86aafda71e0e2@mohiva.com> <9570D903A3BECE4092E924C2985CE485612B4EFE@MBX202.domain.local> Date: Wed, 10 Oct 2012 19:18:29 -0700 Message-ID: To: Clint Priest Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8f5024ee1437e204cbbf3100 Subject: Re: [PHP-DEV] [RFC] Propety Accessors v1.1 From: tbprogrammer@gmail.com (Jazzer Dane) --e89a8f5024ee1437e204cbbf3100 Content-Type: text/plain; charset=ISO-8859-1 This all sounds about right. In regards to #4 - read-only/write-only: I think that, from a "pretty syntax" point of view, private final set() {} and private final get() {} are definitely our best bets. But... from a logical point of view, I prefer read-only/write-only. private final get() {} is technically saying it will always return null. private final set() {} is technically saying that setting doesn't do anything - but it still works. But I don't see any sane scenario where someone would want to do the above. Therefore, it may just be best to use them in place of the currently proposed read-only/write-only. On Wed, Oct 10, 2012 at 5:35 PM, Clint Priest wrote: > Okay, I would like this to be the last time there are revisions to this > RFC. > > To sum up the last few days of conversations, I have these down as points > of contention: > > 1. Accessor functions should not be present on the object and callable > directly, for example, $o->__getHours() should not be allowed. > 2. Preferred syntax for accessors should be "public set($value) { ... }" > with no "magic" $value (with possible type hinting) > 3. Automatically implemented get; set; with auto-backing field should be > eliminated as this is not necessary for PHP and is confusing most everyone. > 4. read-only / write-only keywords, keep them or get rid of them? There > is no directly suitable replacement but I believe a private final set() { } > will take care of it, even though it much more verbose. > 5. Error handling for thrown exceptions should be made more appropriate > for accessors > 6. The "truth" of reflection. Should it reveal details internal to how > PHP works on the inside or should it reflect the way PHP presents it as > options? > > Did I miss anything? > > > I will come up with some way for people to vote on the issues at hand and > we can cast our votes and be done with it, then I will finish the project > and get it out the door. > > -Clint > --e89a8f5024ee1437e204cbbf3100--