Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:101933
Return-Path: <crocodile2u@gmail.com>
Mailing-List: contact internals-help@lists.php.net; run by ezmlm
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 89721 invoked from network); 26 Feb 2018 15:57:20 -0000
Received: from unknown (HELO lists.php.net) (127.0.0.1)
  by localhost with SMTP; 26 Feb 2018 15:57:20 -0000
Authentication-Results: pb1.pair.com smtp.mail=crocodile2u@gmail.com; spf=pass; sender-id=pass
Authentication-Results: pb1.pair.com header.from=crocodile2u@gmail.com; sender-id=pass
Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender)
X-PHP-List-Original-Sender: crocodile2u@gmail.com
X-Host-Fingerprint: 209.85.217.170 mail-ua0-f170.google.com  
Received: from [209.85.217.170] ([209.85.217.170:36119] helo=mail-ua0-f170.google.com)
	by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP
	id BB/03-60937-E5E249A5 for <internals@lists.php.net>; Mon, 26 Feb 2018 10:57:18 -0500
Received: by mail-ua0-f170.google.com with SMTP id i15so10866371uak.3
        for <internals@lists.php.net>; Mon, 26 Feb 2018 07:57:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=Oxh0LO5QtkCLcdRcJF0440+Oihq3DgTjraXUCucPoy8=;
        b=Zie1MpEZQ+ab8U4G0CzmoN08PIQqWUGEUmF52paweuCVqbCFnCDSlo8JXutc4jVX91
         2vplkeLVxkNdiuHkxF25rU1SPPCX5koXwfRD20pkLLXVSO4Ag/tqhMXSp6c/vNVvjLdg
         0UsKBUFEOeoL4ig7iZ9sthk4kgO7XYiyuXNimVhs0HITVquOu/Z0lsrTu0/zSw8D1Gel
         zRXtQ35Fj6RVOOT4QGvefGm05hLfsg5w4k8ZmcdQPc1S6dMGx0ZQiTd4L9/j2cH440X4
         ayNRa6EneN2Z8vC+D6ij+XSPBMwc1TlNkKNnixTc4RYnFjOkM8JUXCgU+kqwKkgidgFK
         hp+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=Oxh0LO5QtkCLcdRcJF0440+Oihq3DgTjraXUCucPoy8=;
        b=M54s/BntIf//lsmLCLkAPEGrWxIR+ziK/8ZgYz92zLSLYsTx+3/qhoZjmz+eeQF35f
         KPajSBlXNsIcAxS4l3gTUF2cBKhX+irvSSSsFp3C39Bn8uSkM1mly4m66lGW+scctpM6
         WxUjvgRPZ+nmoOSeVxv6YuNyaSNKPlBHpSBZJGbG7oAhA+Kujk1hjpiAKmmm29r7yz/J
         8mPYBCCgUqtEHiRXJMqfPuLwiGZ4tMmNbnJCqZh0/5ZI721QQBfVCU3+hhMyH9PL9uwD
         uK9+0BcJ7GzESUV6Vob1ebj7x5h8GbzBEG0sVhE4PCC7vXRbZkm0DpvL/MAskzlzt0J2
         hEQw==
X-Gm-Message-State: APf1xPA/HYE/J9IRbC9NL6aKDmbHN4JzpjH9DASbF1mYZVlhFLhn3V1e
	WfEAR/CFdrJj42RsU7y+Tw1lbeHJtEBn/ddEsa4=
X-Google-Smtp-Source: AG47ELt0oZEDM0N56tTyyLvXtsnkK99pX6PUodIud74stukxPr/MvL1eIkP+agyctzU3QaG+cfZC8XpwsBPkIyJptio=
X-Received: by 10.176.19.132 with SMTP id m4mr8976040uae.197.1519660635974;
 Mon, 26 Feb 2018 07:57:15 -0800 (PST)
MIME-Version: 1.0
References: <CAA69SC79fvaKAT=x=zoUfaqpiK78q68_cdR0vonJAm9FKAwJeQ@mail.gmail.com>
 <CAF+90c-=XtkjmrNV-am3RZ4+XhgJ0WgFCV5Yevjebz2UUh=y3Q@mail.gmail.com>
 <CALKiJKoqPpByQNVMG-3V2Jqjnf=6BkfqEKj96grSdqiJgw1qGg@mail.gmail.com>
 <CAA69SC5z5yxhAHFdbpf_RYBcKia56MZBXuAEk55BhPuiCnFRYw@mail.gmail.com>
 <CAA69SC5irBCAK5k7Adj7-jd-zbTuk+--WhVi0u7e8CnZt81oFw@mail.gmail.com>
 <CA+kxMuTa6zucL2O+n3hf251XABO=UfpFtVNvUA_FXFx6pWz=bw@mail.gmail.com>
 <CAA69SC6yDSJ4jD7By+iHVuBe8x2w_dH+wfiC1EmwkSw=LTNxFQ@mail.gmail.com>
 <CAA69SC6JQ9viE+Z-nxPtOfZVrScT7Cu3UBFFZ1R3WLREq-5YjQ@mail.gmail.com>
 <CAA69SC72se=ZyLhadAUSOhUSaq8pQ=rZT4Ufcx=PKsmS7vqrDw@mail.gmail.com>
 <CAA69SC7ewuka5Oq5yyjSL7X3Jq249WKbkhyq2XXXwBWBOUt6ZA@mail.gmail.com>
 <C7D5FF76-63FA-4A27-8E98-1D030D7D87F0@gmail.com> <CAA69SC7B2VFkj=J4zY+tWpCdSaBxX+TKFu=zE2oJNauNxgz_xA@mail.gmail.com>
 <D9002600-2954-4C47-85D0-E617DCDF1655@gmail.com> <CAGU04mKd_R5eYyogT1-MRzr6xMtAFEKDmpPdq0uxs3vpB9pmOA@mail.gmail.com>
 <CAA69SC4vkpbTNQSeTfWxWPuqmzCspgb2Yp2S2WcVY0433jM-8A@mail.gmail.com>
 <CAA69SC4qntSeNebXupbum-LEqHyLgwG+TDmsWtPVK6xTvK1h7w@mail.gmail.com>
 <CAA69SC7qBkEA9tQnDqbeWsE4XTt21qOKhDmZNv3293LiUj80SA@mail.gmail.com>
 <CAA69SC7ec7z3U5QvTH_GMy9w9p21SCZYykgDN4EvbN-xwg654g@mail.gmail.com>
 <CAA69SC48P1zn+-0G6tQyR6TGrrDBhVT+mg6zKQYpNZkU2+2HmA@mail.gmail.com> <CAH0Uv3HzZvyVorS6LN+u6sNUYPjr1viqo8fN7ZB7NVakfT7Q1w@mail.gmail.com>
In-Reply-To: <CAH0Uv3HzZvyVorS6LN+u6sNUYPjr1viqo8fN7ZB7NVakfT7Q1w@mail.gmail.com>
Date: Mon, 26 Feb 2018 15:57:04 +0000
Message-ID: <CAGU04mL4f=A-DNUeAuk4enxZ2Jjj70Kc54HfveVgMHiFiDmTmA@mail.gmail.com>
To: Andreas Hennings <andreas@dqxtech.net>
Cc: =?UTF-8?Q?Silvio_Mariji=C4=87?= <marijic.silvio@gmail.com>, 
	PHP Internals List <internals@lists.php.net>
Content-Type: multipart/alternative; boundary="001a114562d662f1b505661f9058"
Subject: Re: [PHP-DEV][RFC][DISCUSSION] Immutability
From: crocodile2u@gmail.com (Crocodile)

--001a114562d662f1b505661f9058
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Nice one by Andreas Hennings, I think! I personally have also question on
deserialization of immutables. Is it going to be possible at all?

Another thing is that PDO will probably not be able to use FETCH_CLASS with
immutables, because of the way it initializes properties.

On Mon, Feb 26, 2018 at 4:13 PM Andreas Hennings <andreas@dqxtech.net>
wrote:

> Hello,
> my thoughts.
> For me personally the proposed feature would not be very useful.
> i like immutable objects. But for me the pattern of choice is private
> properties + constructor + optional "wither" methods.
>
> The "wither" methods create a clone of the object, then set a property
> value on the clone, then return the clone.
> This would already not work if the property is marked as immutable
> with the proposed feature.
>
> Also static method constructors that write directly on the object
> would not work, because technically they are not part of the
> constructor.
>
> For private properties the proposed feature would add little benefit.
> Any private property can be made practically immutable by writing the
> class accordingly: Not having setters, etc.
>
> Where this feature would become useful is if someone prefers public
> properties over getter methods.
> But again, this would prevent any unconventional constructor, like
> withers or static factories.
>
> I think a better and more useful feature would be read-public,
> write-private.
> Maybe like this? https://wiki.php.net/rfc/readonly_properties
> (For some reason I cannot open the RFC wiki pages. Maybe they are down?)
>
> This would achieve the same goal: Making a property practically immutable=
.
> But it would still allow unconventional constructors.
> It would be the implementor's job to decide which method should be
> allowed to modify a property, and which shouldn't.
>
>
>
> On 26 February 2018 at 13:52, Silvio Mariji=C4=87 <marijic.silvio@gmail.c=
om>
> wrote:
> > Currently the build is failing in some parts of the codebase that are
> > obviously affected in some way.
> > I ran valgrind for couple of failing tests and I got numerous reports
> about
> > memory leaks and conditional jumps over uninitialized values.
> > Not sure what is the reason for that, I had merge conflict with upstrea=
m
> > master couple days ago, might be a reason.
> >
> > I would appreciate if anyone could give me hand on this ?
> >
> > On Feb 26, 2018 1:48 PM, "Silvio Mariji=C4=87" <marijic.silvio@gmail.co=
m>
> wrote:
> >
> >> Currently the build is failing in some parts of the codebase that are
> >> obviously affected in some way.
> >> I ran valgrind for couple of failing tests and I got numerous reports
> >> about memory leaks and conditional jumps over uninitialized values.
> >> Not sure what is the reason for that, I had merge conflict with upstre=
am
> >> master couple days ago, might be a reason.
> >>
> >> I would appreciate if anyone could give me hand on this ?
> >>
> >> On Feb 26, 2018 1:44 PM, marijic.silvio@gmail.com wrote:
> >>
> >> Yes, I've also took that into consideration when choosing keyword.
> >>
> >> On Feb 26, 2018 11:35 AM, "Crocodile" <crocodile2u@gmail.com> wrote:
> >>
> >> Is "value" or "immutable" going to become a new reserved word? Ain't w=
e
> >> going to have some BC breaks because of that? If so, then "value" is
> going
> >> to bring more BC breaks then "immutable".
> >>
> >> On Sun, Feb 25, 2018 at 8:02 PM Paul Jones <pmjones88@gmail.com> wrote=
:
> >>
> >>>
> >>>
> >>> > On Feb 25, 2018, at 12:59, Silvio Mariji=C4=87 <marijic.silvio@gmai=
l.com>
> >>> wrote:
> >>> >
> >>> > Here is link to tweet https://twitter.com/SilvioMari
> >>> jic/status/965564630071300096
> >>>
> >>> After having read that, I think "immutable" is still perfectly
> reasonable.
> >>>
> >>>
> >>> --
> >>> Paul M. Jones
> >>> pmjones@pmjones.io
> >>> http://paul-m-jones.com
> >>>
> >>> Modernizing Legacy Applications in PHP
> >>> https://leanpub.com/mlaphp
> >>>
> >>> Solving the N+1 Problem in PHP
> >>> https://leanpub.com/sn1php
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> PHP Internals - PHP Runtime Development Mailing List
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>> --
> >> Best regards,
> >> Victor Bolshov
> >>
> >>
> >>
> >>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
Best regards,
Victor Bolshov

--001a114562d662f1b505661f9058--