Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96924 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45127 invoked from network); 16 Nov 2016 14:55:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 14:55:49 -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.42 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-it0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:38628] helo=mail-it0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/61-05303-3737C285 for ; Wed, 16 Nov 2016 09:55:48 -0500 Received: by mail-it0-f42.google.com with SMTP id o1so56264687ito.1 for ; Wed, 16 Nov 2016 06:55:47 -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=m6gsJdw/pL8PlUmlXCAG8RqGQy+UrMUTMsrDnG2teZU=; b=k/g9W4t+xxx9GzIZeP7xGGF+VSqBSIVfuhIitWYojQwK71qMqrvvD2hvnGXVu1vv2H aEvHzza4uxqKOAthA5QyilXtZ48qF5BSoWsgHoFHoqppnVo8r89Ol0ggeHzncwiPErMY 4RE8A4oF5+ki2uBJWu7GfaIaAytBlh7aJsu8TYv/O9SiDdcKx1hkHom03Z2RN/1Hr+H/ Ipp60XAgCBpaXtSwU7xZ4Zy/fcGHKH1ymkrKLsTo1ups9Xmo4CU1LAtlbGi2VZvO0HXm +NA+kzzj6rPdOjRVwdHKEIln2SKIJGAqe8gcP+N25+zcByFhujEP2YzF0IXdfg32ysYh 4RnQ== 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=m6gsJdw/pL8PlUmlXCAG8RqGQy+UrMUTMsrDnG2teZU=; b=WGu83EKbmlkl2o/GwpGO8pWplwvmxeWLWCYchdN0v/uIWDC6HYW9awEH0q2dyXUrpm /+UnZfOtsVikXCTzKu3EzVDSf3F25ykCdi7I17z+4lqdXB6P+RWAvlD9XlLu6k3PRt8C 89m7QD2ghu3Nc9AGFMmnO89qSP0QONnBOZVz5abwkmVrtZ6rOsGsoHpRcfHQj/dkNhEg CIjYCjX3aKNDVkuT2/iNlPvjqkdeIzpj6S/71YI0ko9BzdPLTUYQ7U7SCNmEZZWN6rmi YatG1Ha3Rs2psIm8Rij7FxIj6ZHx/qM9e2gFORR3BlOwZykOgo3BGkTR/fFheCqcpqL9 0p5Q== X-Gm-Message-State: ABUngvdVP4NtG8Mgngk2YZttk3pJUTaz2XxcRfFBahbfJbdfN5p0qmppvdeegJe5HLOdQcXcFLmSutnoTN+nDg== X-Received: by 10.36.51.76 with SMTP id k73mr8647159itk.22.1479308136369; Wed, 16 Nov 2016 06:55:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.63.202 with HTTP; Wed, 16 Nov 2016 06:55:35 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Nov 2016 15:55:35 +0100 Message-ID: To: Stephen Reay Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a113f6a1cfb774e05416c4372 Subject: Re: [PHP-DEV] Immutability RFC From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --001a113f6a1cfb774e05416c4372 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Stepehen, Since immutable objects doesn't have identity, I'm wondering what would be best to do in this case when we try to compare them by identity. Cheers 2016-11-16 15:51 GMT+01:00 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: > > > > Hi, > > > > To anyone who is interested in this RFC. What do you think what behavou= r > we > > should have when you try to compare two immutable objects by identity > like > > this: > > > > immutable class A { > > > > public $a; > > > > public function __construct($a) { > > $this->a =3D $a > > } > > > > } > > > > $a1 =3D new A(1); > > $a2 =3D new A(1); > > > > $a1 =3D=3D=3D $a2 > > > > 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 doin= g > > the same thing. Maybe throw an error ? Suggestions ? > > > > Cheers. > > -- > > Silvio Mariji=C4=87 > > Software Engineer > > 2e Systems > > --=20 Silvio Mariji=C4=87 Software Engineer 2e Systems --001a113f6a1cfb774e05416c4372--