Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127367 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 1FF821A00BC for ; Wed, 14 May 2025 23:26:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1747265055; bh=fduquVhoCZ77hC+SpuEZgxgRQJJgsiU9jmy+l25O9no=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ki0yaRWbn0Q5bGfeoPFPBSjv2xQrbu5LkcUYppPx1FSGWEVgXtLFG8L4FF+zGRTdP 95pk6tXwh5cXvNXoyQIoQshC3wtVcmQtuHtYDNjB9bL0cEEfNYCupKfgCRVU7sYve0 EpII2/CSkeagj6Vy7JdU+3oZ7/1Zv4CSMITeZsdZ8cG8mkTe1PDpdmDx0M7OTNcqiV U73P+DiQehyNQCI0iXARaTt9T90g71fmPZ2YdqHyojWPN/vO1lYjraFBShVNazsb7G YmfhLMQn84+EMuYVASILcSL8GwKR6yBp0uEc+lALRM+itg6NMaBmwx52+MoqwODWxJ M0iYFb8sYt4bg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2029918038D for ; Wed, 14 May 2025 23:24:15 +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_MISSING,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-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 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 23:24:14 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5fc8c68dc9fso706988a12.1 for ; Wed, 14 May 2025 16:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tideways-gmbh.com; s=google; t=1747265184; x=1747869984; 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=fduquVhoCZ77hC+SpuEZgxgRQJJgsiU9jmy+l25O9no=; b=hQ0fjm8mAjSWayv3ZktExME6wgOmu5OaCpM+OjG28qpv3NksPF9441K6p2P8aZtM17 xpdRX1zJdiIMFqn7os1zDDdFR+aNPalIjcbCgib32JeQpcRmOWktyMe3tMqsBwqYtvbB 6xb07bA2u+srnK/+SYDnmUSvSHxoqRg+VmkwE+TLR9aN9qpQ+TmSB0R0M2Ua+9g3H/az XSq2ZSU2ZSnHLGuvsQ6lpqqal8dwqfDPDMSHeef1s5JrWiEnxBJVAE2qKKO6M0ta7zPt Rgv+HKEt0Iy3+2Q25lfuYOWUjTeWo3bAKYDEtSpYTWhIpHa9NY4HaddMizemYqLS4STn 8nyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747265184; x=1747869984; 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=fduquVhoCZ77hC+SpuEZgxgRQJJgsiU9jmy+l25O9no=; b=b+6kyWe6iT7dGq/HSb2CGSRiD9z+tetDqIzfvOAY1FW+Qf1trC40XS1dYpjUEGdr4e oz8IeV8U/PQ6X6hXikAcwptk8VeR0wBg9Irn0c6Epk2B11eIqDU8P0wb330+tAMtz/1t grIpKoWHt2sgoPCrLQcIKvw1285yuaq0Y2cy9B3EDPjAEgzwr2KjHZjxqsJRE6O2HBCK DRATLqst5n6ltbsnaYf45hYAUDSmr9LOu0XMeTjr4ePwoIjEpn07EnOJDse835S0UYgk J3DRng44mwzKZd48IvYX6ofPukSZ3ohMFKdEowdBvD26vn5vntyHb7/6lu+i+3kFQ6cn qjzQ== X-Gm-Message-State: AOJu0Yzx1mcwfWDUfRqV9d1v0PyGR/EJtmt3uKrms3Y1BzxJKNMVzwVE K74E0sjPwwfEJu3BielnKoHg8yXayEQLG/oCH8uD5D8bk56GzvxTmwH9qNNjZuoYHGT/1jPK3tW OAMuoaSsErW2fnwKXWkEYgKoa8pSSA+R1IY41KA== X-Gm-Gg: ASbGncuw6yCgbutJWzswaRlbEZehGLfBaXERa0vXcbrN2pmeO/WpyQKcwiqts2wSR/Y YX32+zSnIeb2bp5Pskk/90V3dqcOzDrMVzagtOwfP9110wngkdxv4sIAI3GIB34SsnLcYxFgWmv 4dZVwSZ0ux019hBrM9uPSto8kCaCMY+Ey6FcpT2fx7jG73sHt7tOrVdI78FJpMn4P2AEf1xGGR X-Google-Smtp-Source: AGHT+IHgXS65I89+xdNNMtNpquG+4lxyKc8x566c+euxPQQxyZtxlptr7KITLDrdJhcEGfo3+EyrpwATnQ0aCficGK0= X-Received: by 2002:a17:907:3da6:b0:ad2:39a9:f1b8 with SMTP id a640c23a62f3a-ad5160f2f73mr19075166b.57.1747265184430; Wed, 14 May 2025 16:26:24 -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: Thu, 15 May 2025 01:26:13 +0200 X-Gm-Features: AX0GCFulsZknA_aUCEmRNMKCUexjav7HvVL3Q9_OSMU44997B8aT6OxyOWEkKOs Message-ID: Subject: Re: [PHP-DEV] [RFC] Clone with v2 To: "Matthew Weier O'Phinney" Cc: php internals , =?UTF-8?Q?Tim_D=C3=BCsterhus?= Content-Type: multipart/alternative; boundary="000000000000a58dfc063520e0a5" From: volker@tideways-gmbh.com (Volker Dusch) --000000000000a58dfc063520e0a5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 14, 2025 at 10:06=E2=80=AFPM Matthew Weier O'Phinney < mweierophinney@gmail.com> wrote: > 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? Thank you for the question. I had that one myself looking at the initial implementation and forgot to write that down more explicitly. Tim already answered and linked the test, but I've also added an example to the RFC. --=20 Volker Dusch Head of Engineering Tideways GmbH K=C3=B6nigswinterer Str. 116 53227 Bonn https://tideways.io/imprint Sitz der Gesellschaft: Bonn Gesch=C3=A4ftsf=C3=BChrer: Benjamin Au=C3=9Fenhofer (geb. Eberlei) Registergericht: Amtsgericht Bonn, HRB 22127 --000000000000a58dfc063520e0a5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, May 14, 2025 at 10:06=E2=80=AFPM = Matthew Weier O'Phinney <mweierophinney@gmail.com> wrote:

> 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 er= ror be thrown? If so, will it be a new one, or an existing one?=C2=A0
=

Thank you for the question. I had that one = myself looking at the initial=C2=A0implementation and forgot to write that = down more explicitly.=C2=A0

Tim already answered a= nd linked the test, but I've also added an example to the RFC.

--
Volker Dusch
Head of Engineering
Tideways GmbH
K=C3=B6n= igswinterer Str. 116
53227 Bonn

Sitz der Gesellschaft: = Bonn
Gesch=C3=A4ftsf=C3=BChrer: Benjamin Au=C3=9Fenhofer (geb. Eb= erlei)
Registergericht: Amtsgericht Bonn, HRB 22127
--000000000000a58dfc063520e0a5--