Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97366 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6933 invoked from network); 12 Dec 2016 14:42:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2016 14:42:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=marijic.silvio@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marijic.silvio@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.223.179 mail-io0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:34255] helo=mail-io0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/C9-27518-D67BE485 for ; Mon, 12 Dec 2016 09:42:54 -0500 Received: by mail-io0-f179.google.com with SMTP id p42so178310335ioo.1 for ; Mon, 12 Dec 2016 06:42:53 -0800 (PST) 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; bh=Vkyjs7gKK0ENWnq5KoAovC1vpRHoe+cSbT5a99vx4PA=; b=DjWDu/2hBBCGVpgGChoVavt9B3ov83JjQzIzHAha3i/2Ra+sRKa4bZWNA5XzLTIgI9 g5ghJMpUP8SWp2T9XMd2jMT1C7qUxZLi03pQ+fxXaLdZeSftZuRz6OPAjWLzf39OyW5H b3GRlusJd2Wf3QjY+hCV1/jkgig9ypTDiFu3x/+R8h/pvcjFiTtxPGPp4d4be42hpwcL c/Q5co0nD/c0lqAXTZ+DEguUSWj5BHfKGmuMJxcb3MS11my7x1Y9JyuT5mjRhB8aCKbD kp4rO4L3kowfguucSAkzJ45pVzVBFSbdUI/u0zOR+p2yz/gzuL6vx4qbunCF5FAw5YHn SG4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Vkyjs7gKK0ENWnq5KoAovC1vpRHoe+cSbT5a99vx4PA=; b=V8OViAthDHafNFXRkJZTyV++gqCRG9gJn71Z6uQ6SvShoiQlzIfoUUkI5JeUtR+9wi yJ20am9DHxXlvqzcjZgpBwMvLXTp5iOIeAo7CLhNHtAGPAm2uM4jj+Ukt2AKG2HMbeL6 gO7dOtpr9qbJbLqHd807JAMT6DB2IWbNjfAOIyZmEHruRPtmJ9cVZi0ilUVs2uqXoTOB FmJojSiUPexEGqFdzoCwUQ/h0Ma72ix4Q/K57tuexiKX7zZ7x7WhI4xV4c0/dUEFQ9uq ea3cNRHwUdak4Y8Egd7d39Uafwxoi76In+Bp7DBzqyWL0acxxBET9ZoJ5dzgD1zJS60S kYxg== X-Gm-Message-State: AKaTC00ObvUf7vov7eacLoMG+ZrAa5SJgqHidRPuXq/X2THmA/ZTXf8igfZjuNN9/+2QXYQMLqZWbgdPGjQ1IQ== X-Received: by 10.36.127.84 with SMTP id r81mr9843253itc.57.1481553731717; Mon, 12 Dec 2016 06:42:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.110.142 with HTTP; Mon, 12 Dec 2016 06:42:11 -0800 (PST) In-Reply-To: <76C07EDB-56B3-46AB-A5C1-92485B32C113@gmail.com> References: <1807f949-81d3-f2c4-8706-0fdade3ea51d@garfieldtech.com> <4635ac4b-844a-b023-5ad9-e8524a156404@texthtml.net> <79ea244b-9fe7-5b05-d429-bf5585215542@texthtml.net> <76C07EDB-56B3-46AB-A5C1-92485B32C113@gmail.com> Date: Mon, 12 Dec 2016 15:42:11 +0100 Message-ID: To: Rowan Collins Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a1147ccc8e5134a0543771b9d Subject: Re: [PHP-DEV][RFC][DISCUSSION] - Immutable classes and properties From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --001a1147ccc8e5134a0543771b9d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2016-12-12 15:14 GMT+01:00 Rowan Collins : > On 12 December 2016 09:11:17 GMT+00:00, "Silvio Mariji=C4=87" < > marijic.silvio@gmail.com> wrote: > >Regarding my proposal above, since copy() would essentially operate > >only on > >immutable objects, why not put it only there. So you would be able to > >make > >a call like this one $immutable->copy(array $args); or > >$this->copy(array > >$args); depending on whether you are inside let's say with* method or > >outside of the object. > > If users of the object can set arbitrary (public) properties this way, > then you've thrown away a bunch of the free encapsulation the immutable > keyword gave you in the first place. What you get is an enforced > copy-on-write, where you can set the properties to whatever state you lik= e, > just not using normal object passing semantics. That's very different fro= m > what the RFC shows, which are properties which are publicly readable, but > whose state is exclusively controlled by the class (and its descendants). > > > PS The rule on this mailing list is too always reply *below* the text > you're replying to. > -- > Rowan Collins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > I understand that, but I think we'll have to meet in the middle. How would you handle situation where for one little change you have to manually recreate not so trivial object with a lot of arguments ? I don't think that should be a deal breaker for this RFC but I do agree that we should try to find solution to bridge that gap and put that aside in a other rfc. --=20 Silvio Mariji=C4=87 Software Engineer 2e Systems --001a1147ccc8e5134a0543771b9d--