Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115232 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16917 invoked from network); 30 Jun 2021 09:53:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jun 2021 09:53:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1CBE9180507 for ; Wed, 30 Jun 2021 03:13:47 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 ; Wed, 30 Jun 2021 03:13:46 -0700 (PDT) Received: by mail-qk1-f176.google.com with SMTP id y29so1814765qky.12 for ; Wed, 30 Jun 2021 03:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=E7dsSEKFSlBTu96aNYdPYM5MGBIPkVuYb6xMbe5OwDM=; b=n4KgTGLL3IMLlBLJ2NUYUOC+E1KkXhVlOIcI9rPRNKZZLReZlVAZTuAK/nUfNi/cc/ lfzNcZ+X4z+l6bhdV28xE/LYL0QfGVXvyQ9ofDp2fh2AXimZbcp24H8RRGI6Qero5x2Q ZWKS9BIpqeUsnZ8Dr+jeGKtfXHpXHywGl+dumYSoopFE3m7YDC3zygDkPT0mRSzqXyo5 Ti4+5fWapNQgfmI7eLM+vSj8Ws80TUADIg42uiQxmPaXDlqlGluVHnldGMDrcrDdyrkp X+JY5xIx0R1SxlyHIvX6IiPl75k8ctmKYXCP+KE3Df/L5yplsCR3KRGJ7fqqg5AgP1qE AWtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=E7dsSEKFSlBTu96aNYdPYM5MGBIPkVuYb6xMbe5OwDM=; b=h4Mpym6GtyCI1kbR7IzcWb44dGWW3pLCrWaPyET5IzRZ3StSFvfkupOboLonWwQWcW m47kKprC+gSw93zCS9MYswzfxYPL789rE4xUo0+JYCVLciEvSNaxi6CEWCe13c5SzGce NE8Z6/UeDuZkegw70RNB4fepvrJjvvBi8fxzMU/3Z9onWKScCYS2PuzEm0/LOG7+EyjQ ipuSKtzZDEmQJEUjvmV35GwrdV5stHToaLNnSl9rGdQ8VV0wAvv034g+9fWRTwj7ILPy U1iUDXbEYOwD6dexE21kVvaAOaIcLig84DeItI79XR9Kn1N8thQzDHWaEwTLbRVQiyhk n/ow== X-Gm-Message-State: AOAM531WA44IkuKEzT0ssfQsTzqSHBKLDsghVENgZMNrK8FiQEFAsTV9 QrjcYi0gsSlgKfmfQL7tiIToVg== X-Google-Smtp-Source: ABdhPJxTVrAAHC+N70fJjv/tHMa5Ouf5mLqjYjj2sK1VD3FiKjp4e61fHocFkLsS5EoXXWkiU42D9Q== X-Received: by 2002:ae9:f006:: with SMTP id l6mr34192848qkg.420.1625048024382; Wed, 30 Jun 2021 03:13:44 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id s8sm9025881qke.72.2021.06.30.03.13.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jun 2021 03:13:43 -0700 (PDT) Message-ID: <0FBB9DF6-A975-419D-8E1D-2153FB6A4CD7@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_DA425247-6210-484B-8DF3-7A43FA0DFD36" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Date: Wed, 30 Jun 2021 06:13:43 -0400 In-Reply-To: Cc: php internals To: Nikita Popov References: <24af2d01-4f6c-4389-a35a-dab50c0b5e66@www.fastmail.com> X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [RFC] Readonly properties From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_DA425247-6210-484B-8DF3-7A43FA0DFD36 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jun 29, 2021, at 9:08 AM, Nikita Popov = wrote: >=20 > In any case, I don't want to include changes to cloning in this = proposal -- > the topic is related, but also orthogonal to readonly properties. > Unfortunately, it will not be possible to get cloning changes into PHP = 8.1 > anymore, due to feature freeze. >=20 > It's okay to vote against this if cloning is a deal breaker. In that = case > I'll probably either work on cloning before re-proposing this, I while back I made a suggestion for cloning which seemed to resolve the = cloning issue in a way that no other proposals do.=20 However, no one acknowledged it, so maybe few if any people saw it? = https://externals.io/message/114729#114747 = Anyway TL;DR, the approach is to allow specifying a closure on clone, = binding $this to it, and then allow modifications to readonly properties = while in that context and anything that it calls: $clone_obj =3D clone $obj fn() =3D> { $this->foo =3D 'new value'; } Would this not be a viable solution for cloning, for this RFC, or the = only you work on if this one fails to pass? -Mike= --Apple-Mail=_DA425247-6210-484B-8DF3-7A43FA0DFD36--