Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120063 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25208 invoked from network); 18 Apr 2023 08:19:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Apr 2023 08:19:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5C6BB180506 for ; Tue, 18 Apr 2023 01:19:58 -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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 18 Apr 2023 01:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1681805996; bh=gsGWGbrwDF6yhYqkkMvw+ibLupHqn5wGKtcwdVoGalY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=PtmWQSWFZvWATG5g14skhVJ8qvMGoAIhlNtUtLOHbsJ5xg4/mLQPH+ClsOsu/H3og Xh/z99MBk+YL6PxTJbjx4m5aAN4QEkXQcvSBOEaT+HQEKU+OwHDg9HG4BJlc7qj+6M qw6Ie9coCr8NsKP/PwBtWBfIaD5G3aaqJMAOlqPI+Lb0ZD/rFNAgby8D/q4f+7k1SC sXNDLRx14BmNEEdLN0wNvRgTKzrU6KwO7RpIox2GI+zNs5Zm2/Zjv4floHEZZZXvu1 C+ZDuYaqx9/gISfsdvTrmePFZVge0M7YdOnfAhWmLkbkU7dv7WX+GFW+AHQ02vlrpW uzaQ9UYKOEcEg== Message-ID: <0831b1d0-6898-8ef4-0154-f62598db5397@bastelstu.be> Date: Tue, 18 Apr 2023 10:19:54 +0200 MIME-Version: 1.0 To: internals@lists.php.net References: <305ba080-817f-bbb9-7378-8bd3616ab94c@gmail.com> Content-Language: en-US In-Reply-To: <305ba080-817f-bbb9-7378-8bd3616ab94c@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Clone with From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 4/18/23 10:10, Rowan Tommins wrote: > 2) How does this interact with an __clone() method? I'm guessing the > __clone() would be called first, and then the with-clause applied? > More generally the order of operations with regard to possible side effects and/or exceptions would be interesting. clone $something with { foo() => bar(), quux() => baz(), }; In which order will __clone(), foo(), bar(), quux(), baz() be evaluated and what will happen if one of them throws an Exception? Will destructors of the cloned object run? When? Best regards Tim Düsterhus