Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95767 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56314 invoked from network); 8 Sep 2016 07:41:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2016 07:41:28 -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.214.46 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.214.46 mail-it0-f46.google.com Received: from [209.85.214.46] ([209.85.214.46:35820] helo=mail-it0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/30-36123-62611D75 for ; Thu, 08 Sep 2016 03:41:27 -0400 Received: by mail-it0-f46.google.com with SMTP id e124so241297756ith.0 for ; Thu, 08 Sep 2016 00:41:26 -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=T+r5z4X3jRwse5S5jcW0OefWlNFGHO+MSSvAejlKqU0=; b=QfsOkxuy8zuBoVLK4Aqn5biW3N6euvAy/fJI3wvkomC7Y6I/5h9VgKDlOuP0VS1Vfu QOyGqO2OJsj422tm3lfZcRu0rlnnQbQh2sMlAIoJB27Y9NXWTlFLF9pL3Si2/Bn7mp5z X7vP5nteRZwRqh2AYMe8SrnvGqGQv9OFXaDZGaEyT3g88J+ZH/YjR2tqsSIVB8ywLDYN 2rroWHCHrv97iivWXqVnFOnJUbaWCTEwS0w1/35036FIB1g4Jm6zRSlwnvmIcgO4uTcn gloICNLODuwI9EH/+DJC3qt6hHRVf6iAJXHf5W3inBerfcEQSm5gbCNJkTHkO6s5kUtX GC6A== 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=T+r5z4X3jRwse5S5jcW0OefWlNFGHO+MSSvAejlKqU0=; b=eqyImJ6PptPlX0Lsgfxb4hmIWB/ujv3tGfA69+c5SwbZN1JWCe+ovfLYfmZQMzKFD0 OUTvbtFng9XPUtNxNDsti2mzHdZ4PQGF9Ul2QlQicIvU/cC5KjWzpf9nCsLfssbU/w0l ZC4eQ/0FJ8mfVm7ka7q6l5eZY0P1PRUxHxUkcoR1C4gsF7VrX9GvSc8ZLGDoOprRuKW3 vWBO1aMP92OSAsEstBUAjf873Jr97LGx+k3qwAEkYTGjpit+GHU8qClI/QmPCfIAny9H vSKJCoHXlsE8hejyuFzGGWU5fJ+cZcYGGPH81R4c1fYxm8y6JXvS4a9TNB8ozeq/RZXN giyw== X-Gm-Message-State: AE9vXwP5N0ksNSRZXFo+q7aaNP8JxOmr3zG/CGY/RSED0op1W264VepsBhvV54rskIOHo0AKHvjN9aQK80KI9A== X-Received: by 10.36.39.67 with SMTP id g64mr12616031ita.93.1473320484334; Thu, 08 Sep 2016 00:41:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.237.74 with HTTP; Thu, 8 Sep 2016 00:41:22 -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: Thu, 8 Sep 2016 09:41:22 +0200 Message-ID: To: "Christoph M. Becker" Cc: Mathieu Rochette , Nikita Popov , PHP Internals List , Andrea Faulds , Stephen Reay , =?UTF-8?Q?Micha=C5=82_Brzuchalski?= Content-Type: multipart/alternative; boundary=001a1147cc8e1bf168053bfa28e6 Subject: Re: [PHP-DEV] RFC - Immutable classes From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --001a1147cc8e1bf168053bfa28e6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @Christoph I get the nostalgia :) I think that *zend_compare_symbol_tables* compares only hash tables whether they contain same properties regardless of the values. 2016-09-07 20:44 GMT+02:00 Silvio Mariji=C4=87 : > @Fleshgrinder > > I will make changes that if immutable objects are being compared that the= y > 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_proper= ty >> > and can easily clone it, perform the desired changes and return withou= t >> > 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 wit= h >> > 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 >> >> --=20 Silvio Mariji=C4=87 Software Engineer 2e Systems --001a1147cc8e1bf168053bfa28e6--