Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96920 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37724 invoked from network); 16 Nov 2016 14:29:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 14:29:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:35362] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/DF-05303-44D6C285 for ; Wed, 16 Nov 2016 09:29:25 -0500 Received: by mail-wm0-f52.google.com with SMTP id a197so243027936wmd.0 for ; Wed, 16 Nov 2016 06:29:24 -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=/Vv7WbQK8FmY91HCz8h2zD9g1npXqisKXCDmf/eIa2U=; b=nxghD5g4KsDIpzhcjTQijcRVAv7CXIjyp+frR/5k66OFNEej1tPhsacaXKNX3v7EfG LyJoaBBU4fvkZQskSyfQTMQxsxSZHmL0tcqzznowDcPeRmSGMDBTkzJTWrzNfaMlAVb4 mMJPDiV3fc/X3I6+PVvjjNJWkYpsablQX7iX9DJa7QDPFUrLVASKzAvIB0I/UAACcLuo Gd6mb6J+KivimRd/88rzBkBYsMUt3QVSP9Zh3T7cjC/HLCbtbnTnDZ4w96+W4yTDvZUd eYuyiD6X8CBvcYe9JsdQ5OisAzujZmLbfgk2PxshYHuud7egaNvxVnoo3t5fTMjwFWXP UCRA== 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=/Vv7WbQK8FmY91HCz8h2zD9g1npXqisKXCDmf/eIa2U=; b=WEOnQYyNmpH4UQ5BPJA2dr9rW0BFVB7MBvca2LrNjmDTaSy6+2sQPcdN78XRXK8kc4 8nqNpNTIGfFW37GNU3OmDGCXxNFiQXtQsJBf1LGuvOe1R+3pGmVD5bj09/Eb1duAgaqp EBh6mGuiMgQqRpi2YQX1p20EIFblfJDR8yxsRLxLZ+rpfjqzycTND0ZdGnNA4ShavKdZ +gTWFl+N4qE3iaSGXaPSE4ml1Cwk9PG0OR2XkpQNy81hNp6ejx4so6pI7/7fJV1B1W5h Nw5h0osRo0xvh7L+NBEZTxHu47jhKzEc04ikJDNYJC64BX46oEyBPPfGsRSnKc0rCyEJ 956Q== X-Gm-Message-State: ABUngvfUdpJoepNNWERWCtlhk//CjD6/r1rdw1y6c5akqhob7f2r+FiJ5KV/LjyS31dJDc15x70dKJP2GKKqGg== X-Received: by 10.28.144.70 with SMTP id s67mr3857271wmd.138.1479306561757; Wed, 16 Nov 2016 06:29:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.140.15 with HTTP; Wed, 16 Nov 2016 06:29:21 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Nov 2016 07:29:21 -0700 Message-ID: To: =?UTF-8?Q?Silvio_Mariji=C4=87?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a1146b33420a76a05416be6b2 Subject: Re: [PHP-DEV] Immutability RFC From: derokorian@gmail.com (Ryan Pallas) --001a1146b33420a76a05416be6b2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Nov 16, 2016 at 6:57 AM, Silvio Mariji=C4=87 wrote: > Hi, > > To anyone who is interested in this RFC. What do you think what behavour = we > should have when you try to compare two immutable objects by identity lik= e > this: > > immutable class A { > > public $a; > > public function __construct($a) { > $this->a =3D $a > } > > } > > $a1 =3D new A(1); > $a2 =3D new A(1); > I would personally expect that: var_dump($a1 =3D=3D=3D $a2); // bool(false) var_dump($a1 =3D=3D $a2); // bool(true) > > $a1 =3D=3D=3D $a2 > > If we treat those objects as values then this should return true. But the= n > again there might be some confusion because then two operators are doing > the same thing. Maybe throw an error ? Suggestions ? > > Cheers. > -- > Silvio Mariji=C4=87 > Software Engineer > 2e Systems > --001a1146b33420a76a05416be6b2--