Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127418 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 0534F1A00BC for ; Wed, 21 May 2025 15:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1747841500; bh=aMNV6E1d8OXpP2eZZIh8vVSYlrAL7wQCHkJSTRHBgTE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hwkrKYZ4DL4EhtjT+3325yMfjAtCnI/TFWbO7BpFp1gR5bjtGlO3BimJqKISxkmY9 dEKbQK36dSn93eWgRRL9+84ToROv5UGjIhbCGn8hZM5wFAJx9/AY7iDJXRwtVLijsu ybQsDrgQtf9hUK/41cN195rcw7MV/OoiGf5ra9tfx1RbVqiCB+jT2nTe6ncr92/qcC oRuUAVctDO8Zf49oJWZga4F5zss2n7F3XHbyLR0Vh0eu/05pq+mkTHqmQf3A1Wm0w6 /BE8X7BFD0n6g58MtZtOw6QnXzlu35uqY3JZvcY2b0raMknEo0tNInEKBhnPVhfiPH ms3cF0LXtvfhw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B1DE8180061 for ; Wed, 21 May 2025 15:31:39 +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.2 required=5.0 tests=BAYES_20,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.0 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 ; Wed, 21 May 2025 15:31:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1747841626; bh=PmycxMKjRfOBT5P16D6ZdY3eyui14JmVpDzTILliP/g=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=LktpvCuNrEXN6OMlrwm2rp8oe+9rI8ed9OkEJPvnEuO1gUzxYQJGYGW8ZsEIyK/XF kY6JegFg4GW8+Rquze3D3OnsKt7ZDmFnxiS5j97cQzjcKjCENzGXyE899oXVxr4iF8 6S0B76ImT/JHJNWdDxoI52AUElz9FqbZAXRfmGZzwv7mBeUfAbfBI1/jblM1sem6mS 82WvlI2T4XH+PVSoM1YCUcuenSAFoc6iSjpOYSFghXd+Bn7Ngl+z8+p3EWsvLxP6VE egTImeFRDcGvYEWgYZS762bOSr0AYitfqp7Kw15hpwnoZulkdeyxB3jYwMiz+mGD5V /sEWRFgXztB0g== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Wed, 21 May 2025 17:33:46 +0200 To: Theodore Brown Cc: Volker Dusch , php internals Subject: Re: [PHP-DEV] Re: [RFC] Clone with v2 In-Reply-To: References: <2f30cae4add309021e18d0f359a1814e@bastelstu.be> Message-ID: <09f161aae8cdf8ecc65f3795412af8a2@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-05-21 17:27, schrieb Theodore Brown: >> Combining named-parameter `array()` syntax with clone taking a array >> as >> the second parameter would allow for the following, which might >> combine >> the best of both worlds? >> >> clone($obj, array(foo: 1, bar: "baz", object: "this is not >> blocked")); > > I really like this idea! If it can work without any function call > overhead, > it would enable more ergonomic array creation not only for `clone()` > but > also in many other common scenarios. Yes, the implementation in the PR comes without any function call overhead. The logic to support the named parameters is purely implemented in the parser. The actual function implementation is provided to “round off” the implementation and because it was super simple to add. Best regards Tim Düsterhus