Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115185 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15098 invoked from network); 28 Jun 2021 18:10:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jun 2021 18:10:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2A5A81804D8 for ; Mon, 28 Jun 2021 11:30:39 -0700 (PDT) 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,HTML_MESSAGE, 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-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 ; Mon, 28 Jun 2021 11:30:38 -0700 (PDT) Received: by mail-ed1-f41.google.com with SMTP id df12so27367407edb.2 for ; Mon, 28 Jun 2021 11:30:38 -0700 (PDT) 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=i8CwyRZBNx4DV9FhOAzxm0z4Hhz2LVdxJ3r8MPaFXe8=; b=djDgKyT8SWnvKhpsN7n2sZUYDFGkg6COpNTpgM3MxZz3oZoszvFxeQ9mxleMSV2Snz f/JrJFcIyquhUvIrK/wdfKkkOACiiluJPXHTvor8jEgzqeQyMLoRwVnNgNwPFqzLwSFb GEQ66kZf1Vcd8OBAW3ejZfx7O4Kma7JoIXCKU5tbjZr9vN3Xiz1Da8F09D158znUfeXf ttgRaXf7K12Fe4qgwxUbzRVeVpslU3Gm/GJbgLFCMI4foLd80vBhzuj65dsLVDdD6QPR G9QHtA/5oP0/LchDcQrOGlF2I9dFlj+Ku37ZJ6CoozVQGcnb1I50RZ0wwYpjVWjLqBhJ 4c8g== 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=i8CwyRZBNx4DV9FhOAzxm0z4Hhz2LVdxJ3r8MPaFXe8=; b=h6O+dZ2zZy7pWQ1wR+fXhudcgvUbe9I9oYDn9PXfIbu/NJL5vbpr6sLftzYnaGALmv syRK7nY/GneQUfTNhAOgS49+cvTrAsY2wYsddvT3XatoXxedOOpBX15YwM5sDZ3zXN6h xPO1IRIecFhLBOygxuobE+pZXih+PW78GeT4UzIxm0DIY1n+W8NKdD3a5smd9kDfe6ek 4sUIbFGrIrxlegVLhCK8nGCU4CNPcWkIc+mpDGknVt953B+/XRXw8lEIEaBovxTKVPP5 ixrbr5oqbqzN3b0YqMDVL7kfFRJ2bXufJHG7WQzcY+wVyO0ago13MntQ4pBoTiWKwXqp 22gg== X-Gm-Message-State: AOAM5320zrJVozj9mIBlV3VY95lqosKQOFiBCUdDqJA8k3oYc0uVaqjA 5vjgNkTS5RoErYRQruIp8QNkXNDjJMlXltYYobI= X-Google-Smtp-Source: ABdhPJwfTCjIviUSkWp5PQitfJN9y8/JPIRhfQoxrlbTchdQMRB89rK/Ad1jJdX+eoJUUopR4q02JxV82VP2FoqEPT4= X-Received: by 2002:a05:6402:158c:: with SMTP id c12mr34064069edv.335.1624905036492; Mon, 28 Jun 2021 11:30:36 -0700 (PDT) MIME-Version: 1.0 References: <24af2d01-4f6c-4389-a35a-dab50c0b5e66@www.fastmail.com> In-Reply-To: <24af2d01-4f6c-4389-a35a-dab50c0b5e66@www.fastmail.com> Date: Mon, 28 Jun 2021 20:30:24 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="0000000000007e751005c5d7afa9" Subject: Re: [PHP-DEV] Re: [RFC] Readonly properties From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000007e751005c5d7afa9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le lun. 28 juin 2021 =C3=A0 18:22, Larry Garfield = a =C3=A9crit : > On Mon, Jun 28, 2021, at 11:17 AM, Nicolas Grekas wrote: > > > > I'd like to open the discussion on readonly properties: > > > > https://wiki.php.net/rfc/readonly_properties_v2 > > > > > > > > This proposal is similar to the > > > > https://wiki.php.net/rfc/write_once_properties RFC that has been > > > declined > > > > previously. One significant difference is that the new RFC limits t= he > > > scope > > > > of initializing assignments. I think a key mistake of the previous > RFC > > > was > > > > the confusing "write-once" framing, which is both technically > correct and > > > > quite irrelevant. > > > > > > > > Please see the rationale section ( > > > > https://wiki.php.net/rfc/readonly_properties_v2#rationale) for how > this > > > > proposal relates to other RFCs and alternatives. > > > > > > > > > > I plan to open voting on this RFC soon. I don't think there's anythin= g > > > technical left to address here, the discussion mostly comes down to a > value > > > judgement. I think everyone has made their position regarding that > clear... > > > > > > > Actually, we talked off the list about a way to possibly make this work > > with __clone(): > > > > We could allow __clone to have one argument, the object being cloned. A= nd > > when the signature declares this argument, then all readonly properties > > would be set as uninitialized on $this. > > > > A typical __clone function would look like this with readonly propertie= s: > > function __clone(object $original) > > { > > $this->readonlyProp =3D clone $original->readonlyProp; > > } > > > > That would turn my vote into a +1 if that could be made to work! > > That sounds like it would support deep cloning, but not with-er methods. > There's no way to provide a changed value. It also would mean a lot of > work on larger objects to transfer across all the properties. I don't > really see what this would add. > Can you elaborate about the lack of support for withers? Having some work to do doesn't look like an issue to me, especially when there is no alternative to compare that too. --0000000000007e751005c5d7afa9--