Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127360 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 D5E701A00BC for ; Wed, 14 May 2025 20:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1747253062; bh=aYYBOYY3P/mChqriZKJkWUPv3FpXsovRSxSkF3t5GYs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=aikCYM1w6MmmlY4s7FIAIxb1Z0XlHGghdM4z1PnbLo9Qs0LKHeH/FKe6GReh/G4gm KtONu5ReRCs6bk78kZeVJpX/Xqzyqablk0zlY1JrUZp5KfvWKezaEsdJgpgSorCX89 SB6o1+oxvFC224RZVc96S+032Dsy5EjmILATgizxbAindfbZDcEKwbU1UAWMblrXdG spZRaTlNoVcnN6RJp9Dr5pl2lJvfXgqJhYG2CDL7fmboP3xbOgKnD8dYrRxQRhicJK X5PPaZEkAHs1/HXpB5IyKzCBkz5p+LlypSDKxC1/zHKJqN6+/GpuK6pcV1FSQ7jq0Q hTD+uh5CqZfcQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7A6DA1801FD for ; Wed, 14 May 2025 20:04:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 ; Wed, 14 May 2025 20:04:21 +0000 (UTC) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-310447fe59aso2023011fa.0 for ; Wed, 14 May 2025 13:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747253190; x=1747857990; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aYYBOYY3P/mChqriZKJkWUPv3FpXsovRSxSkF3t5GYs=; b=gV/QkbZQoLpuzXDyb060scNQgYoplxoFPy/lOQDxCQy33uTgYoWSYM/Y9FOjXDn7mk zrtL57CmVqg/wAxLpdIjvHAG7M6rBlaOTVWjJzEX6eS6fgAzS40rYxEFXZFaK/4a7b2B UWXh2QQPel1QqT/2izx7A1r/1SjC2/7jtS6F20uHarpL1hO49npNbyCYkuGuyjkTBgEN JkAWRxETgUzKfdqJMiBaVHBmpEUZrNWCSHKJRkFtTKqHxXFLSR+gXrumZ83CbEtCZlpZ ntlKcyJTT2Qw9h964TE8sy4xu/eGmFJuagqGjZ1sn2m4jOyD5weHOvsxJycXp7JI2yEq ZRWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747253190; x=1747857990; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aYYBOYY3P/mChqriZKJkWUPv3FpXsovRSxSkF3t5GYs=; b=o9OBDPZhqzNabxSlsKWD0nK+8bbBxEUWCW9M8biLzk74BnrxykdyHeTJ7BAh5xWtcz eCHGenGxeYNAEaN1foxIStm0Utv4D03Ccz8GFGT31nHqGFMh82f4Y0ZUealvk13fRuyv JYYWbrtCHBJjx+L9wEQ/Z/b6evw80YSPQFIwWHk19DY+mpv99sCTRUyOOaYjVtDHW4eg e5iBO5xrWBqgMbBypA430s0la0Ln8vrO1VksOuuh+8DLjfnqIHQEWJhMMIJ9g66XZHQY I02twE68v7PcokEYygSGHx4TZuE7959sKvKszFZ5eVO7unk3E2LFcQ24p0hyZVwVd1T2 C8+Q== X-Gm-Message-State: AOJu0YzyfcpRiIMrdOZ7l7/K/SVkKxp/ITP5dZZrmPnUke9qn1Dqx2d8 nYJ2E44sIsxyQhssMtib76kmAd8mIvcM0BEIDnHW9lHUj5G+pzxexkqVtwsJG1I8MgJGy6k6Y1p mPBSSwC8QiVhdR6Fr4hQn+46tG+w= X-Gm-Gg: ASbGnctiSWWOpgQZlotcm9d8Ziq20bg7DJdwjtnkBuzFbJJldw5JApcBP7SRzuij1y4 foS7c/un73IF5isWtKas4ERGsntXCJuOYPuYMsLXdPQhP7Df7b0mh+SWII7PRcizW0hdwMesZxs W4EyavpT4bG3NvtEtuWvGlEaqM07/zztk= X-Google-Smtp-Source: AGHT+IETByCufCIYLgyQk0iWDaFKCFKzR8gTUi9GP/K+8fZp+EZ7WOKQmkv6RTrk0f8erC++3NNef6PuH6eyIZPUTcY= X-Received: by 2002:a2e:a99c:0:b0:30b:d562:c154 with SMTP id 38308e7fff4ca-327ed0f8e65mr21047301fa.19.1747253190124; Wed, 14 May 2025 13:06:30 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 14 May 2025 15:06:18 -0500 X-Gm-Features: AX0GCFsn-aDxynpQvIAhReuqKtvp0vS-hLbFTC4RwS2UrmHxnQa_tduvwcptO8Q Message-ID: Subject: Re: [PHP-DEV] [RFC] Clone with v2 To: Volker Dusch Cc: php internals , =?UTF-8?Q?Tim_D=C3=BCsterhus?= Content-Type: multipart/alternative; boundary="000000000000bae98906351e159e" From: mweierophinney@gmail.com ("Matthew Weier O'Phinney") --000000000000bae98906351e159e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 14, 2025 at 8:06=E2=80=AFAM Volker Dusch wrote: > A couple of weeks ago, we stumbled over the fact that the original "clone > with" RFC was abandoned and thought it would still be useful to suggest a > trimmed down version of the proposal. > > The main goal of this RFC is to propose a lightweight, low friction > implementation of this feature to satisfy the couple of use cases we see > and "round out" PHP in how it handles cloning, especially around > read-only-properties. > > https://wiki.php.net/rfc/clone_with_v2 > > We are actively looking for some feedback on > https://wiki.php.net/rfc/clone_with_v2#open_issues, but of course all > points are welcome. > The only question that arose for me is: what happens if a property name is provided to `clone()` that does not exist in the class definition; what will be the behavior at that time? Will an exception or error be thrown? If so, will it be a new one, or an existing one? --=20 Matthew Weier O'Phinney mweierophinney@gmail.com https://mwop.net/ he/him --000000000000bae98906351e159e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, May 14,= 2025 at 8:06=E2=80=AFAM Volker Dusch <volker@tideways-gmbh.com> wrote:
A couple of weeks = ago, we stumbled over the fact that the original=C2=A0"clone with"= ; RFC was abandoned and thought it would still be useful to suggest a trimm= ed down version of the proposal.

The main goal of = this RFC is to propose a lightweight, low friction implementation=C2=A0of t= his feature to satisfy the couple of use cases we see and "round out&q= uot; PHP in how it handles cloning, especially around read-only-properties.=

We are actively looking for some feedback on=C2=A0https:= //wiki.php.net/rfc/clone_with_v2#open_issues, but of course all points = are welcome.

The only question = that arose for me is: what happens if a property name is provided to `clone= ()` that does not exist in the class definition; what will be the behavior = at that time? Will an exception or error be thrown? If so, will it be a new= one, or an existing one?=C2=A0


--
he/him
--000000000000bae98906351e159e--