Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96921 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39222 invoked from network); 16 Nov 2016 14:34:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 14:34:37 -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.53 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.214.53 mail-it0-f53.google.com Received: from [209.85.214.53] ([209.85.214.53:36893] helo=mail-it0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/20-05303-C7E6C285 for ; Wed, 16 Nov 2016 09:34:36 -0500 Received: by mail-it0-f53.google.com with SMTP id b123so55516559itb.0 for ; Wed, 16 Nov 2016 06:34:36 -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=hhwYTkA6OPWW1qTZX8pYKCiSXGfmE2sBtj/U6UYoeUE=; b=LWp5y6uhDqFKXa9fQNhmRuE44SELstey4kVy7w3t2vjD4N9tvDtKOCxY2I35VhLQYo OIg45cFlWCrHScPwOoJ47p6Ih8SNrHLh7iYECs98JsRG+sFZvCbdLRMxigLUDpVtbd0j SLhDbV1XB5+NJ98z8sH5fFFBtqUAr+iqDWHBiKFObqHubH2eJT5zJnipPVPdKp50rbRX JoRGEqPOH4+OW0Q1128/ZtFd/g9xBEuOQTkx35FIHXx6dx+PozVclhzqAaxK7D5SsZNj C6s4F0cR5fWwtvRYLzVXGZMa9iZeXa3Qut3yE9C1WxgAHfG/1U4Am7jOLyGJcJ2YTZrH HNyQ== 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=hhwYTkA6OPWW1qTZX8pYKCiSXGfmE2sBtj/U6UYoeUE=; b=Nmy0qhbFfKg+MSHrz/OZWbbOwSre3c4xrvCabqNhtKZ2T7awi3pXShc4Z4tP1dYRVT m1ib/G8SoKquuOytieB3oQ4qD+uzQtT3Gwcfi0pcbdTyueR1/+Mjrln76as5tRYH76PA P/vw4QjqUe5zzHYjIMNOiSZpOFNZHLTBah5Ucn0/p5XVaTq6qxAONw73svTsc8NudqE8 fZNcMkUuz6dTRO/zDrgnLxxDdeTrBOjrF8sWa9cYFbtj8XcFVc5STF0WcfVl4iuxSnhW jW+GpdoGNO2Vo0RTDoor+mcw7w/MP00iucsM/dfnhZDAVaDh7WMje6Tmpy4+p5lHXKqa mRUg== X-Gm-Message-State: ABUngvdAlimxz07L1hXZEle+2b4oK6FVMRIo6m+gxsFszvX7DHCJWmKyR15TWKArKWPmwsrPMxpuQ4azsXNl5Q== X-Received: by 10.36.69.155 with SMTP id c27mr7863902itd.1.1479306872189; Wed, 16 Nov 2016 06:34:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.63.202 with HTTP; Wed, 16 Nov 2016 06:34:31 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Nov 2016 15:34:31 +0100 Message-ID: To: Ryan Pallas Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a11c15196a1798305416bf80e Subject: Re: [PHP-DEV] Immutability RFC From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --001a11c15196a1798305416bf80e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @Ryan which is existing behaviour in language. Because object is immutable I don't think we should care anymore about 'references' instead maybe we could focus on value that object represents. 2016-11-16 15:29 GMT+01:00 Ryan Pallas : > > > 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 li= ke >> 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 th= en >> 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 >> > > --=20 Silvio Mariji=C4=87 Software Engineer 2e Systems --001a11c15196a1798305416bf80e--