Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115177 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97587 invoked from network); 28 Jun 2021 15:57:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jun 2021 15:57:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3C64F180539 for ; Mon, 28 Jun 2021 09:17:31 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 09:17:30 -0700 (PDT) Received: by mail-ej1-f50.google.com with SMTP id yy20so23141911ejb.6 for ; Mon, 28 Jun 2021 09:17:30 -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=GAAT7ubqYMNwzHyDwgyb993dT4mQSoOcR3Z+iiw+WxU=; b=hF3BY6Zb0C/GSUlZLQlKwvynAUBOudgcVBCc5x3dPuN17pdt1tZeJM3D5VmbbeHdxX dMQ6Tf7bJFphwCWiZCfzPK70A4yRM5OAogbg7qgAqAek/JSJBOPdtBSmGfSvqf6ZWlug wwo0WqrteDk4s3TAbeKmUSSgBW4Byb4SjvYMnZz/UTPXIgaEmiuq644o8EjaWU1NsRg8 zCqQAad+YCBYlalhYVDQoOiz2SBOydyjzjGS0YBFCoLeYI8aHFjQUzD4dGJ7s58IKzOv ik7BGUqLx4xjxngeNv3klAOlDDEGO8Lgo5FInbOmqYQqVTwrVJDuCdKOfb/P3hICQ8Xr 4+Mg== 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=GAAT7ubqYMNwzHyDwgyb993dT4mQSoOcR3Z+iiw+WxU=; b=SlOtFi7/6OBYV2jkk7RlmTioUHaFrUk0BmqlNxpKI1rQCwLt6YP9tbkT4z8JzaCu27 IifyBwgCe3RoPkwQkF+kYXA3npdfDg8q58EEuns/2Gy6tBch1Z+ax6jvgG80C+9Qbs3s uPdvkzrVNGZ8nYQ1EH96ubiPIISbMhJVpr6laLy6UBTOo+0JVkByJ6j4nurCyah4yADL LEESc4cBP/X5gk7lBxMWN5GtzMUXG0Dsbcp4SMpg2lxtPs1uwXBIipSUyKPb9a+Nbzde z9zznwhYE4l5qy0WCRJDYLYBk8ptpjd3XZzmQGE0npFtHK7rd8g1V4go6XCU9hV1YEsl lljg== X-Gm-Message-State: AOAM531aSqxKTcsBvMGFo7MyAd8m99neGQGDTcQCfGM9RwoA+MKvWhbk 78wLAjJFxoZCIrzdcGVUaygrEBx+u/7CASf13eE= X-Google-Smtp-Source: ABdhPJyByRhJjnPa/8ueZFaJ7uAuTXxFjWip+IeSDRXlI/sPIeZOjw320/jq0NWOgpVJu46Vv1dmFRcIz7We9ll9284= X-Received: by 2002:a17:906:f0a:: with SMTP id z10mr25963373eji.115.1624897048580; Mon, 28 Jun 2021 09:17:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 28 Jun 2021 18:17:16 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006096a105c5d5d314" Subject: Re: [PHP-DEV] Re: [RFC] Readonly properties From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000006096a105c5d5d314 Content-Type: text/plain; charset="UTF-8" > > 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 the > 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 anything > 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. And 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 properties: function __clone(object $original) { $this->readonlyProp = clone $original->readonlyProp; } That would turn my vote into a +1 if that could be made to work! Cheers, Nicolas --0000000000006096a105c5d5d314--