Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78335 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7309 invoked from network); 26 Oct 2014 10:30:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2014 10:30:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=j.boggiano@seld.be; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=j.boggiano@seld.be; sender-id=pass Received-SPF: pass (pb1.pair.com: domain seld.be designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: j.boggiano@seld.be X-Host-Fingerprint: 74.125.82.45 mail-wg0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:59296] helo=mail-wg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/A8-36207-F5DCC445 for ; Sun, 26 Oct 2014 05:30:56 -0500 Received: by mail-wg0-f45.google.com with SMTP id l18so3705937wgh.4 for ; Sun, 26 Oct 2014 03:30:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ewy+iRSE+8jG7wwzroNkctlzOvvIeZvMtYRdkBe9Xqg=; b=SujOB4JKmnsK75FmL7/VAEiES6sBt00/wUPHF1az/E6yj1F0pIXyqgFcbpTXTL9kL/ /5BTD1OF+r+PFiMKitaqcnZ5ov78Cz2YJ7rt3phdBX8XI4aLFDTnujj1fOBWfF3YUBal R8nTkKEQbL6CxVHNDMqwAxqkIa39sw2U3MZj7ahldbCqirWm2QV3+7t7c7wC4IWlDLsv eEISTrnAlK/bYz56pOuE/okdDDaM/inLkrPpr2DYkOdco9jwkc+QxbSKgS+Mx8mfnmGU WlziSINxQylsXyS3XH9aACqSQT9g90fgwNukpn1rb3Hc/sNBmHH90TSeLXtNaB/6/2Bj ZRMA== X-Gm-Message-State: ALoCoQnYUSwD5Yo0KSoUjU4j1goAMnEhL9gdNN60FVx9XJv15Gc82JmcGQz4LN3rAb+yGmRIhj18 X-Received: by 10.194.92.12 with SMTP id ci12mr15511828wjb.6.1414319452002; Sun, 26 Oct 2014 03:30:52 -0700 (PDT) Received: from [10.0.1.19] (cpe-74-71-44-174.nyc.res.rr.com. [74.71.44.174]) by mx.google.com with ESMTPSA id fa16sm7855046wid.5.2014.10.26.03.30.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Oct 2014 03:30:50 -0700 (PDT) Message-ID: <544CCD5A.6070404@seld.be> Date: Sun, 26 Oct 2014 10:30:50 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Andrea Faulds , Pierre Joye CC: PHP Internals References: <6E04B9BE-854E-4112-8C74-7D90BD8BFE95@ajf.me> <544A1BF5.3090708@seld.be> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Readonly Properties From: j.boggiano@seld.be (Jordi Boggiano) On 24/10/2014 12:54, Andrea Faulds wrote: > >> On 24 Oct 2014, at 10:29, Jordi Boggiano wrote: >> >> Thanks for the work (again). It's an interesting small idea but I'd much prefer revisiting the original getter/setter RFC [1] which had a majority but just fell short of the 66% mark. >> >> This RFC only implements parts of the getter/setter functionality (readonly properties) but it does not address the fact that sometimes you want to add logic to a setter or a getter and if you don't have language level getters/setters you end up having to change the interface of the object from a public property to a getFoo/setFoo pair. >> >> This leads to everyone having getFoo/setFoo by default just to avoid interface changes or mixed interfaces of public properties and setFoo. > >> >> On 24 Oct 2014, at 10:34, Pierre Joye wrote: >> >> As much i really like the idea to have better properties management in >> PHP I see this RFC as an attempt to solve only part of the problem >> while dropping most of the other ideas implemented in the past RFCs. >> My take on that is that some will vote no, or won't like the idea of >> adding anything in this area. Making compromises and implement partial >> solutions will only delay the implementation of the complete solution. >> >> Many of us agree that __get/__set is a pain to deal with.The need of >> readonly, writeonly or properties with some logic to define or get a >> value is a lond due need. Many other languages support that out of the >> box since long already. Past RFCs, like the c# one, proposed that. I >> would rather focus on trying to find an acceptable syntax and >> implementation instead of doing baby steps like that. Baby steps work >> very well for scalar type hinting, solving one issue after another, >> etc. But for properties we are at the risk of hainvg a serie of >> separate RFCs solving the properties management problems in different >> ways bringing even more troubles and inconsistencies. > > I think I might be misunderstood, here. While getters and setters can > do this, and I’m very much in favour of also reviving a simplified > version of the getter/setter RFC (previous one was way too complex), > I don’t see this as partly implementing them/baby steps/etc. I fact, > I think readonly properties could work together with > getters/setters. Fair enough, thanks for the clarification. It also sounds good to have very simple getter/setters when needed and simple properties + eventually readonly otherwise. issetters/unsetters aren't extremely needed. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi