Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127654 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id E756D1A00BC for ; Thu, 12 Jun 2025 08:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749718319; bh=HThxMa2SNlC+d03GVI1BreGxWaPZLNVxPWfRFFYCF7c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kyRLvQL2NsG8f12lGatZEARkW9Vuc6QmjafvxIj7ojY3ZfyLmAffvb7hp3yPolE/D 3HwtDCKut7zDhEkmL4gnpQFgBJoOD9SrlZO/NE7aZfvfCnp2p3tuMq+DKD01iRzqwt GwHU6QZK/r2WkqNFV1wQSREEWlO8nL3INrWU5QjvFXiiZaMZ/YTLwVEkpyD5n6WnmU tSYcjIf6bXXEf1CFrkbAs3waXl2lzu/FEntbuJjQEVa9HDVPqCLJWWWS7t78QiADfJ xhDJSf7Pzwb3AR5Elal2aGlx9q6wex9xE6ZGNbmanqRyr7412Slu7Fe70vTiAZS3bf tQ2kllNna1d/A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 107E818006E for ; Thu, 12 Jun 2025 08:51:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 12 Jun 2025 08:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1749718436; bh=amOEWV3yZjdGgWHtYHHYlwJRYe50vfQoVadt4YpQGko=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=jfRvunTlgdodJcmUu84h67sRkMhD/vfju0PUMxoPzip/Rx0vR9IeycGMUW8Z/AfIW AHSFxZowtVxylgyXcjFrM1RLJIJ9jtB6O1LBsFwvuKid6iLz/fL/HSXntJZpzlvJRP 7BXBawfrfgECsPDovCjDoyVYqeNqwuCIIFqxegKC/oKNxo0TFdiUPN2VVai03XO4/B MpQvREBeTDx6Pew3YCC+X81/FaWKWM8PFKBtZJAMwtp7umm3Pjz7hox0B2GCVj/hGA kDa4UZ8yOVhsglZLSh4XLxc87vsLzyIrUaHEuBk5vDg8FKRlTbIWpnr46JWkbLPIb5 fXtzMV03rWstg== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 12 Jun 2025 10:53:56 +0200 To: Andreas Hennings Cc: Volker Dusch , Larry Garfield , php internals Subject: Re: [PHP-DEV] [VOTE] Clone with v2 In-Reply-To: References: Message-ID: <6745e59cae2225e1e5c06fd7e686defb@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-06-11 22:09, schrieb Andreas Hennings: >> Calling __clone() afterward would mean the new properties would >> already be set and the old ones gone, contrasting existing behavior >> and thus users' expectations. > > But in fact both of the following sentences are true: > - Currently, no further changes are applied to a cloned object after > __clone() is called. This is only true to a very small extent, specifically for `public public(set) readonly` properties. For non-readonly properties, the user could just write into the properties after cloning, for `protected(set) readonly`, the user can just overwrite `__clone()` and for `private(set) readonly` the class is in control. Rowan already summarized that during the discussion in https://externals.io/message/127353#127389 and Volker confirmed that we agreed with that. > - Currently, no changes are applied to a cloned object before > __clone() is called. > > Both of these statements can describe user expectations, but each of > them justifies a different version of the RFC. Best regards Tim Düsterhus