Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112633 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3488 invoked from network); 29 Dec 2020 10:54:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Dec 2020 10:54:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6834E1804C4 for ; Tue, 29 Dec 2020 02:28:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 29 Dec 2020 02:28:47 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id o17so29825339lfg.4 for ; Tue, 29 Dec 2020 02:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zgDCU3rHgVnv8yT5n9hi3myMBO29qTFOLUifI41tb18=; b=G44TzjTr2Nvr+OINOU0PaUTPTFGx7mCZzULrVMZ6lWDQyRHPYHNxGef7SEQTqphnpm Kuk4tkN3Ya+AZ417aQDTNOhBIvMYE2dC66dJ/5YmTDTuCpuB5QSx8CikitZjaocW8Xs6 gXPnm4Hzg5FSWBRG4wbwWktTI4JKPP96nwgclpIzni7P82lzYt5HjWxCP9D0enFHO/2n Al23H7JtzN5fsL17jc3dAeb9N4kvpQ2olkjUB5LR3XyhzwGBJCZEnAxjna8A4cJvoDPB NJSPkT6aknKhf9hT9xLNNM+CK17LBs0nxJYHHpXKWxnp6C00j9pcAo92AuIi12Q3urTn h+sQ== 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; bh=zgDCU3rHgVnv8yT5n9hi3myMBO29qTFOLUifI41tb18=; b=hzAzENhCqgI+qO8aUogDesA/WVyIbHuEV/UDG3iFv8d+J+82gpyl1MtOuWukyQKvuo mu1bMggJCjtUD4fV2nGUipqbFxXlps30091slIwcTTNmQ98gamBKZK1vOuXq2XceuXZF Y/thZ8Nrmpo4ktxGKHI2jF7uvqGah0MGgq0nh0BoDzrXJmna2Rw486kO5ZHpDVXSbg/o gV50EnFdCB8N9ueYS7cardGeVlA1vtj9LAJpCjS2WqI8KhTn09d2MKM7QIx3+f+Kc4HZ /QAuMYDY5K6zjN22fF/DC325RzZeH6RvOTKqmG51X0FEhtBV3tUZHthnLb/K7ubbi3V7 +lBw== X-Gm-Message-State: AOAM533dhZPKnb7hAjcJqm0nFN65ystqYTmpHfOh/in338l75cUXQfpD Rpp6nePZxaeNsnsXOyP9jj8/vkA4L/Y0Iwo3or8= X-Google-Smtp-Source: ABdhPJyIHC4CTkMFfyIJ/RmaKnI1fHfhkcMaxzWPxHiRWFbeQiyIlhdJjppF1bcl2ujd710HWhJ++D2noO4r7mJi2+g= X-Received: by 2002:a05:6512:3048:: with SMTP id b8mr21616098lfb.421.1609237722198; Tue, 29 Dec 2020 02:28:42 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab3:7110:0:0:0:0:0 with HTTP; Tue, 29 Dec 2020 02:28:41 -0800 (PST) In-Reply-To: <03108284-740a-4a5d-130f-15b2e67e9df9@mabe.berlin> References: <1d0abb04-4987-43a9-85bc-bccc3bd6be9a@www.fastmail.com> <03108284-740a-4a5d-130f-15b2e67e9df9@mabe.berlin> Date: Tue, 29 Dec 2020 10:28:41 +0000 Message-ID: To: Marc Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Analysis of property visibility, immutability, and cloning proposals From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2020-12-29 8:26 GMT, Marc : > > On 28.12.20 21:23, Larry Garfield wrote: >> There's been a number of discussions of late around property visibility >> and how to make objects more immutable. Since it seems to have been >> well-received in the past, I decided to do a complete analysis and context >> of the various things that have been floated about recently. >> >> The full writeup is here: >> >> https://peakd.com/hive-168588/@crell/object-properties-and-immutability >> >> I hope it proves stimulating, at least of discussion and not naps. >> > > Thanks for the nice write up Larry! > > Is there a reason you didn't mention the proposal for immutable classes? > (probably because it never went into a final RFC) > > https://externals.io/message/94913#94913 > > https://externals.io/message/79180#79180 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > I just want to mention that immutability might be applied too liberally in the current discourse, and in some cases, what you really want is *non-aliasing*, that is, uniqueness, to solve problems related to immutability. I think methods like `withX` is an anti-pattern, in fact, and a symptom that you do not *really* want immutability, but rather uniqueness, at least in some cases. Olle