Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96923 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43536 invoked from network); 16 Nov 2016 14:51:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 14:51:32 -0000 Authentication-Results: pb1.pair.com header.from=php-lists@koalephant.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php-lists@koalephant.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain koalephant.com designates 206.123.115.54 as permitted sender) X-PHP-List-Original-Sender: php-lists@koalephant.com X-Host-Fingerprint: 206.123.115.54 mail1.25mail.st Received: from [206.123.115.54] ([206.123.115.54:54834] helo=mail1.25mail.st) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/11-05303-3727C285 for ; Wed, 16 Nov 2016 09:51:32 -0500 Received: from [10.0.1.23] (unknown [183.89.46.231]) by mail1.25mail.st (Postfix) with ESMTPSA id 498A860AD8; Wed, 16 Nov 2016 14:51:18 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) In-Reply-To: Date: Wed, 16 Nov 2016 21:51:13 +0700 Cc: PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: References: To: =?utf-8?Q?Silvio_Mariji=C4=87?= X-Mailer: Apple Mail (2.3124) Subject: Re: [PHP-DEV] Immutability RFC From: php-lists@koalephant.com (Stephen Reay) Hi Silvio, I don=E2=80=99t see why this wouldn=E2=80=99t simply return false? Cheers, Stephen > On 16 Nov 2016, at 20:57, Silvio Mariji=C4=87 = wrote: >=20 > Hi, >=20 > 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 = like > this: >=20 > immutable class A { >=20 > public $a; >=20 > public function __construct($a) { > $this->a =3D $a > } >=20 > } >=20 > $a1 =3D new A(1); > $a2 =3D new A(1); >=20 > $a1 =3D=3D=3D $a2 >=20 > If we treat those objects as values then this should return true. But = then > again there might be some confusion because then two operators are = doing > the same thing. Maybe throw an error ? Suggestions ? >=20 > Cheers. > --=20 > Silvio Mariji=C4=87 > Software Engineer > 2e Systems