Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95765 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30112 invoked from network); 7 Sep 2016 18:44:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2016 18:44:31 -0000 Authentication-Results: pb1.pair.com header.from=marijic.silvio@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=marijic.silvio@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.52 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.214.52 mail-it0-f52.google.com Received: from [209.85.214.52] ([209.85.214.52:35675] helo=mail-it0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/74-06456-F0060D75 for ; Wed, 07 Sep 2016 14:44:31 -0400 Received: by mail-it0-f52.google.com with SMTP id e124so213993334ith.0 for ; Wed, 07 Sep 2016 11:44:31 -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; bh=xrFFAY6v+qvR71hZoHVONKyS8vbdxXRZUJ2djkKHbtQ=; b=DStyuZNXkDvkh7cSyeAtqBS7bjDjaKwWB2l9NslYXRO1suTZGuVfugPGlw/kphkATc NI2DOFYKHO+QhK60YmthQu2JdxWNBz+ByQo+la4Whg47PedXcLAusSIDdrXUN71NhAPQ 8+09bndXxnNCuhRY6vgAfb/42F7pxwFqXm+BxnVY4ioCQKYNziN+PiqemchKErWEiSCg XRScnDp1srxMKVpXGDIu/l5ECyOimT+PcGCkJ+GQNAl0vUwPIojg6yJwpKWrMAP4yD5W nEYfXpjt6G1n+76GItli9zO7o78M1vggy57gwzF/HicU33BRoG5FMA6bAlSC8t+ZJNus 5SsA== 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=xrFFAY6v+qvR71hZoHVONKyS8vbdxXRZUJ2djkKHbtQ=; b=NpOWlwK173RJR7aFycTvp5QQyNWVZB5qn7TEtLr/1cBS4mdUsDgcgPTCnIcY+Z7Zwt Y8secfv4iEn13n91dzKGyoPiZ6rmVYJQHwTB/sZf1JPtcNKU1px/nj+sYBCZcOq9590T gbu9S9JD6QM/XUh4z8lBNAirAuiiM7v+48DBeEyOQn52/oBLNv/CRdATzTR9Yu6jX9RR aWLqBAfJptHm0EGpmZyhgUQrQEpo7urdvlJEVARwera4KNSKQXLBy9z/VDbxJayVMoau 014TXjehrNgXzssjDe0wfE88N2DL8kNo+kNFk995XNUVpWB/uRdVYn3NTMKziOSZJk9F JLZA== X-Gm-Message-State: AE9vXwM9rpDa1R5W0ZurPsDcX4nh72xwFz3NAVzVEEblFaSWD+HRj9fJKAub+9svRhMTlOC+Mj1U+mgYKejaCA== X-Received: by 10.36.152.5 with SMTP id n5mr8322171itd.79.1473273868581; Wed, 07 Sep 2016 11:44:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.237.74 with HTTP; Wed, 7 Sep 2016 11:44:27 -0700 (PDT) Received: by 10.36.237.74 with HTTP; Wed, 7 Sep 2016 11:44:27 -0700 (PDT) In-Reply-To: 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> Date: Wed, 7 Sep 2016 20:44:27 +0200 Message-ID: To: "Christoph M. Becker" Cc: Mathieu Rochette , Nikita Popov , internals@lists.php.net, Andrea Faulds , php-lists@koalephant.com, =?UTF-8?Q?Micha=C5=82_Brzuchalski?= Content-Type: multipart/alternative; boundary=94eb2c05f7f8982721053bef4dcd Subject: Re: [PHP-DEV] RFC - Immutable classes From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --94eb2c05f7f8982721053bef4dcd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @Fleshgrinder I will make changes that if immutable objects are being compared that they will be compared by value rather then hash On Sep 7, 2016 8:27 PM, "Christoph M. Becker" wrote: > On 07.09.2016 at 20:11, Fleshgrinder wrote: > > > On 9/7/2016 8:57 AM, Micha=C5=82 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_propert= y > > 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 =3D new A; > > $b =3D $a; > > > > var_dump($a =3D=3D=3D $b); // bool(true) > > > > $b->p =3D 1; > > > > var_dump($a =3D=3D=3D $b); // bool(false) > > > > It's only about writing to existing properties. > > Ah, good old PHP 4, see . :-) > > -- > Christoph M. Becker > > --94eb2c05f7f8982721053bef4dcd--