Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95764 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25914 invoked from network); 7 Sep 2016 18:27:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2016 18:27:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.19 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.19 mout.gmx.net Received: from [212.227.15.19] ([212.227.15.19:52196] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/14-06456-21C50D75 for ; Wed, 07 Sep 2016 14:27:31 -0400 Received: from [192.168.2.103] ([79.243.115.246]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Lu874-1b1SUy0eog-011PMZ; Wed, 07 Sep 2016 20:27:10 +0200 To: internals@lists.php.net, =?UTF-8?Q?Micha=c5=82_Brzuchalski?= , php-lists@koalephant.com, =?UTF-8?Q?Silvio_Mariji=c4=87?= , mathieu@rochette.cc, Nikita Popov , Andrea Faulds References: <0e71d28e-1d64-5372-b58d-e54c7afae3b8@fleshgrinder.com> <642a6e78-90ea-cbf0-ec1c-376c24e568c5@fleshgrinder.com> <0800a5ca-3d14-c541-1a1a-2574ec802b8c@fleshgrinder.com> <83fa661e-2d3d-6548-a506-fb969be31c0e@garfieldtech.com> <56acc1d9-f424-a460-59be-3a9a1a74b198@fleshgrinder.com> Message-ID: Date: Wed, 7 Sep 2016 20:27:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <56acc1d9-f424-a460-59be-3a9a1a74b198@fleshgrinder.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:qn8LCkEE1HXDZt9O5Gb/3xegokEegtuJwKZtWVmshSLJOuEc7qF S/lTjnOQdLqXUb8PEp/umMfmFnjIsRT5IlCIVqDeqVpb919BVKvtWPdcBu2WjQPBjuUiBec uQ6j8K8SBmcHXREyKciWLYykYKxBiY7FufraNj0DKh2QXOX2yu3ReZ2vQtHwOhOBqDFavub pKA2S+1ZKdd4wXGGzmujg== X-UI-Out-Filterresults: notjunk:1;V01:K0:FJiSza4gmtA=:N5uV3QjwA/Tu6tuPnXKc5E M/r7u6n81XGdx/x0cBjeo/luSF1qS4odlS83n4ICq4G1tj/9UfBILwojfkuzDUp+y6HSIJev1 si7MikCoQTpdYgwDjdV24BC4WCH46NTgJVDUxMhxa289baVKP4o03GVhBIoStR5EykCqR0lhd z88ISirGEiZRnjM0uwAD01y/HvEcitdjjMgrYnybgo0M6XsMMYNl8JYBEeYBw2HlwKuywsdSw bKcWbQ29XjE4rJWYx0qF7xvH0NyfuNrqA0TEUYiUKVyfSl5X7P2aCrY78bgcpi7F2BcbvdO7N RXvQgj6HOFfpJwStXMOjGvMgTTDyIRtvyWVYdzW8LXWGJKCNfagh55dfQWG5Wg2Oh/GP80HKj 3f0bPcLOlwfNxfJn5i6ELNsMI99V1rGw5NCNmRfEkBhc+3rsJ82lxQFiBpdzCjyozoJ4bjsp0 EMLgtP5szpZaRiYf1C8WC6W3IpKz659LEEOpIj1geIGJ2RforQkbUu4IyeGqsQp/+81MidZw3 uFDSkaaaZbfLt7Xy03WU5L5+1dXuOs+uPFdZmomLckKZ8QP3fhfK1fvuN+KaOrgUDFbCp7Td5 IJQGVrzI9IB9DYJAAheF9DpT02kbHtuH+VJ+zILP9kS3rhJM+eA+8CAmrj+nnFI7aH/zRY0a2 GBgFeFH6IG9DhN1c7TWM9ashbeYp7Hg5SRxgmEmt+OwBqvf2Gwg6dj17pKjnSEeUYqMKZwCq5 euzW6GqTzVGyqzWATEcHAQSgx4+fwrTaLaypiCAgMlbEEvVKZou0gdI/740CagsgpavHbKGm1 IHX8BZb Subject: Re: [PHP-DEV] RFC - Immutable classes From: cmbecker69@gmx.de ("Christoph M. Becker") On 07.09.2016 at 20:11, Fleshgrinder wrote: > On 9/7/2016 8:57 AM, MichaƂ Brzuchalski wrote: > >> AFAIK CoW in case of objects would be impossible to implement. > > Nothing is impossible. :) > > We have full access to the real object inside of zend_std_write_property > and can easily clone it, perform the desired changes and return without > affecting anyone. > > I am not 100% sure how to do this without fiddling around a bit. > > @nikic and @afaults: I am really sorry to bother you both but you guys > simply know the PHP source endlessly good. What do you think, would it > be possible to implement copy-on-write for an object as we have it with > our scalar and compound types? > > final class A { > public $p; > } > > $a = new A; > $b = $a; > > var_dump($a === $b); // bool(true) > > $b->p = 1; > > var_dump($a === $b); // bool(false) > > It's only about writing to existing properties. Ah, good old PHP 4, see . :-) -- Christoph M. Becker