Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120073 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32885 invoked from network); 19 Apr 2023 15:46:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Apr 2023 15:46:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BFEB81804A9 for ; Wed, 19 Apr 2023 08:45:59 -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 ; Wed, 19 Apr 2023 08:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1681919157; bh=4BLUHaEozF9pb3MAE5zFHUDjteUdnhVaBiq9/cGx4+E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=bzsw6Q67t4zlnZrgsZ86+lHd6FHrxwP4RYXS804eFnh3rpKBHZhklBXrco5g93TMC AQeyGZBnC6ab8liKIxGFZMlGhYIbmtSTf2LkTgfg2/4nLbRlMFzgN8KEsaR54ukL10 Ngd1/Pn5rZhGm0dfa92q1rbIZrmNrEDOeWpuQbEARxOBOLdjEX+FZnpGcjBbXRl1bU YTuVRxK1TLq9CGTEkyXy5MrWQKQugIrFx/QtUHexlE3u1TZof2utWEQwhXnuV+Wd+w MrktahpaLIsUiAwffHQ6AoaU21Bkt07nKCxa58SHfUcaeUPwB0gnDkaN++F7/axUaz mknbEyUx9wApg== Message-ID: Date: Wed, 19 Apr 2023 17:45:55 +0200 MIME-Version: 1.0 To: Andreas Hennings , Bob Magic Cc: php internals References: <687944e3-75ec-446b-bbd6-6d3d6856e864@app.fastmail.com> <1b842b25-c038-f647-67e1-b8c986b7d51d@bastelstu.be> Content-Language: en-US In-Reply-To: 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/19/23 17:26, Andreas Hennings wrote: > I wonder what this means for performance. > Will the expression always be evaluated as an array first, and then > applied, or can php do a "shortcut" where it internally treats it as > an argument list, even though the syntax implies array? > The different will be small, but it could become relevant if called > many times over. I've said it before, but I'm going to say it again: Performance should be low in the list of things that decide how a feature will look. Opcache and the optimizer can always be improved in the future, syntax cannot. Of course if a feature is unacceptably slow, it is a non-starter. But in this case I expect it to just be "there is optimization potential", as creating an array with a handful of elements shouldn't be unacceptably slow and also 'clone with' is likely going to make up only a very small part of a request's entire processing. Best regards Tim Düsterhus