Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101932 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87239 invoked from network); 26 Feb 2018 15:12:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2018 15:12:10 -0000 Authentication-Results: pb1.pair.com header.from=andreas@dqxtech.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andreas@dqxtech.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dqxtech.net from 209.85.215.49 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.215.49 mail-lf0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:43849] helo=mail-lf0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/A2-60937-6C3249A5 for ; Mon, 26 Feb 2018 10:12:07 -0500 Received: by mail-lf0-f49.google.com with SMTP id q69so22709588lfi.10 for ; Mon, 26 Feb 2018 07:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SMtGZ7UKUSumodv0ituvOE+VaWcXWczgSB6/dFDwn08=; b=g1RP35tT5JDqRAlKBo2oXnqSVw5nXFPYse9if9AlzSQSa7HmcYi75KWInvX76rHzNM 151vPo78re8t7yABdNDhknZrLMORkedg8fhIAwKSmR/8cjfZ+UUKDklAUtNK8zQhx0+X oAVXtLQfVMDf0OHdXm39OX5TBEaUmKzITLazjaU4FyqIyVnnrxyGJuuu/y81Mh3NJYOt F7KZeicbgGo5Rg2VL3DMELvDRCZUiQinbIMfsFVYKDXocWMYTrjxKvGmWiYW72I0A1kd sTD5uaUxsIvGX/BIe5fvdniSZDZ/wUTqTqbEMKNYQ1LqLZfFChBqZfyQiwI+c7D45RCo 1/Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SMtGZ7UKUSumodv0ituvOE+VaWcXWczgSB6/dFDwn08=; b=ppdupWUW2tMzu2VMJDarquNUnu8YIAWwaR9botBjUrkOl+r3MjnzlbL0uZAmvD7YP5 I55sA/5tOovmp0eE8uZgy9L+7q0ro1qjs01fNBL7pTBQ/0ubNvIAHAlC2tG5+h8G95ZI e6WtE0cTB7zZpMO//1/VzjXa6+K0jwhWqRX+/0W/0oBDYQm8Phs39sXvgj/sJS6pwxNN m55p4D2Id/eQvmwxvtkt3g5jmf29Uuq+H1LS0pxU5nFpSC3Wh3SLuH8yk8wLicSEFzWJ jTmHUuuB9pJKXzSpwr6W3fqct8b0iXc59YBM2IEGx9AmSmtQ+99wswmxdHlfGRX1ViWW dQ/Q== X-Gm-Message-State: APf1xPDa/EiTvuv9f27lRcp0AJ78qNws1JxP+hwtC/f6YS0AxMCvh3kb Zkb5hdggjqKOB/VK7DWCdCgYyeJI X-Google-Smtp-Source: AG47ELs2ub6CQY+6BTKl5ssd/BGPvijdCeT8vN5TRdIFUFf2TP9GybvIlTteRxGQDWh35TVLkLldnw== X-Received: by 10.25.28.196 with SMTP id c187mr7596876lfc.44.1519657922991; Mon, 26 Feb 2018 07:12:02 -0800 (PST) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com. [209.85.215.46]) by smtp.googlemail.com with ESMTPSA id f6sm2042853ljc.41.2018.02.26.07.12.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 07:12:01 -0800 (PST) Received: by mail-lf0-f46.google.com with SMTP id f75so17698147lfg.6 for ; Mon, 26 Feb 2018 07:12:00 -0800 (PST) X-Received: by 10.46.20.67 with SMTP id 3mr8413924lju.104.1519657920229; Mon, 26 Feb 2018 07:12:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.225.78 with HTTP; Mon, 26 Feb 2018 07:11:39 -0800 (PST) In-Reply-To: References: Date: Mon, 26 Feb 2018 16:11:39 +0100 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?Silvio_Mariji=C4=87?= Cc: PHP Internals List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV][RFC][DISCUSSION] Immutability From: andreas@dqxtech.net (Andreas Hennings) 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-privat= e. 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 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 abo= ut > memory leaks and conditional jumps over uninitialized values. > Not sure what is the reason for that, I had merge conflict with upstream > 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" = 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 upstream >> 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" wrote: >> >> Is "value" or "immutable" going to become a new reserved word? Ain't we >> going to have some BC breaks because of that? If so, then "value" is goi= ng >> to bring more BC breaks then "immutable". >> >> On Sun, Feb 25, 2018 at 8:02 PM Paul Jones wrote: >> >>> >>> >>> > On Feb 25, 2018, at 12:59, Silvio Mariji=C4=87 >>> wrote: >>> > >>> > Here is link to tweet https://twitter.com/SilvioMari >>> jic/status/965564630071300096 >>> >>> After having read that, I think "immutable" is still perfectly reasonab= le. >>> >>> >>> -- >>> 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 >> >> >> >>