Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63308 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55069 invoked from network); 9 Oct 2012 23:46:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2012 23:46:46 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.220.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:46809] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/16-23861-467B4705 for ; Tue, 09 Oct 2012 19:46:45 -0400 Received: by mail-vc0-f170.google.com with SMTP id fo14so8327728vcb.29 for ; Tue, 09 Oct 2012 16:46:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=7H2jVYzy1vMfd8vy1K8MvHEIwn/PP1RdulCvG2G90Tk=; b=p2LgqJg/VbmHhzoFHC3TCaVl9dhF8zPaqvnOAsL+0RnIF1xFYOgNWAdezbk6q0G7PA Z4w0unT26aWy46vntaaGRxyloMHoAquSQOrZvjGJ87ycXCpsZF2dHD7mZaiNUf4EJ1om P+S+mNBDLyJaRszKLnwWu5nXRNc04rB7s9hVoyZ0uymjMnjt2gR5GoE1gOiAy3c3t6id 0uw9bdgmPvHQMKFEdZ0n8oYogNtVCPaj7jfRc9YUuh1dhtDV74e0sCzGt7RqmwD3jVQ0 Z5eF0bRVq+Bjv87RnKsLYPy6/PfGmIOqqU3pydCT3aDotySTUNkwEgrbefHRDiEn+k7T uqMQ== MIME-Version: 1.0 Received: by 10.52.75.72 with SMTP id a8mr10330175vdw.66.1349826401489; Tue, 09 Oct 2012 16:46:41 -0700 (PDT) Received: by 10.58.146.103 with HTTP; Tue, 9 Oct 2012 16:46:41 -0700 (PDT) Date: Tue, 9 Oct 2012 19:46:41 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf3071cf982b529804cba8f399 X-Gm-Message-State: ALoCoQk/u4AqJaTQ8AiwSmi6mvaDAWacEARH5nKFx05qNvVsJSveWkRoGEZRV+8kgmv0ljUIeAcy Subject: Re: [PHP-DEV] [RFC] Propety Accessors v1.1 From: rasmus@mindplay.dk (Rasmus Schultz) --20cf3071cf982b529804cba8f399 Content-Type: text/plain; charset=ISO-8859-1 This looks great, and essentially has everything I had hoped for! My only remaining comment is on the read-only and write-only keywords... this seems really superfluous and strange to me - the syntax (using a hyphenated keyword) and the feature itself, is way off the grid as compared to other languages. In my opinion, this is a feature that is so exotic, it's likely to never actually be used by anyone. What I dislike the most about this feature, is that it's existence may mandate a "best practice" of declaring read-only properties as read-only. What I mean is, because this feature exists, anytime you're declaring something that is read-only by nature (because a write-accessor makes no logical sense), you would be expected to declare such a property as read-only. In other words, not using the read-only keyword for a property that only has a read-accessor, can only be interpreted in two ways: 1. it's an oversight, or simply bad practice. 2. it's an implied invitation to implement the write-accessor in an extension. Case 1 of course shouldn't happen, while case 2 would be an extremely exotic and far-fetched scenario. I understand the justification for this keyword - but the use-cases are just too rare, and they don't, in my opinion, outweigh the disadvantages. This feature just feel clumsy and out of place to me. I will never use it, and I would strongly prefer not to have to think about it, having to declare read-only and write-only deliberately. For 95% of cases, it's going to be perfectly obvious, both to me and other consumers of the code, why or whether something is read-only or write-only, and the extra guarantee or insulation against error in the marginal 5% of cases do not justify the effort of having to declare it explicitly everywhere. Just my two cents... ---- Subject: [PHP-DEV] [RFC] Propety Accessors v1.1 It's been a while since I posted any updates about this, a few individuals have been asking about it privately and wanting me to get it out the door for PHP 5.5 release. It's come a long way since the last time I posted about it. RFC Document: https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented --20cf3071cf982b529804cba8f399--