Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119403 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70349 invoked from network); 23 Jan 2023 17:27:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jan 2023 17:27:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 46C0D18054F for ; Mon, 23 Jan 2023 09:27:06 -0800 (PST) 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 23 Jan 2023 09:27:06 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ED3B55C0224 for ; Mon, 23 Jan 2023 12:27:05 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Mon, 23 Jan 2023 12:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1674494825; x= 1674581225; bh=Xbh3NxVPWyV8CdNuKfQxQ1Cdj/Rs+APHz9X9kKZUob4=; b=C GxFSoSIuptNz6mpAOUeMgOs20tE9Q7Dciq0lRu6HjIh0JhiIRotf84AsSBbJPvNJ HkTQ/hr8zoRLjAewfMcuj0+MF/9QKcaaiPupJWrWPY1NloJWH4/sjPQF+iW2d4gE qn8tBslvTIWg1A0MNEgLoPfJrk7IYplJqMO6SVCb0t7n2dOzYF3t/fgT3Se1GXG0 iLBWkz2WzkaFx8Uh9kqODWtijxU8Uc0MN46kb54x7bqWwYJfk4cPtJSjaFOJ+M2g ysUxao29cyZ7os44oI39GET+RcG+OMqQqIfnEat4qfq2dE+Jmw6qtNZ9dH7x2ZbT Ll8vUkmgNTWDOeA4CtyUQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674494825; x=1674581225; bh=Xbh3NxVPWyV8CdNuKfQxQ1Cdj/Rs +APHz9X9kKZUob4=; b=JCrX7pke3CgcuvcBT6TgCpev+gdAQ6vushsHEDy0IQbc 814tQZOka/trBo7eIN84MGA1vQ91sjUYKbY38crIgzFnFQU6qnxcMqdueLCezhqy qHPAoVnROShKKn0letp0Ab+0CL8GycKWFhPMTdCsurxR04vnhx91Dx1VmPt+wpQX hpke6N44F0haLDBap/QPIWT9sRWRtAkxPOkI7QRe44hrBHFKyPLgXzmO6KFnh1mK rKsaP4uhmP8C3H031V7PtSJ+u7nY7ly/70YyEf7BlyJEoNNnX4j4Zgisj5JmCcyK ZqoHmGDAlBJ6dlOGpUAKu7NxS1LiCa5CCeFlABQ4wQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddukedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id BA0A51700089; Mon, 23 Jan 2023 12:27:05 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-85-gd6d859e0cf-fm-20230116.001-gd6d859e0 Mime-Version: 1.0 Message-ID: In-Reply-To: References: <8f530a4a-bf48-4259-877e-16ebf8082936@app.fastmail.com> <88a59c46-9261-43f1-874d-ffc2f9caff32@app.fastmail.com> <99bc38dc-3d62-4a1e-a99c-e5daab3d779f@app.fastmail.com> Date: Mon, 23 Jan 2023 11:26:45 -0600 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jan 23, 2023, at 10:08 AM, Robert Landers wrote: > In my mind, Test::Func(...) should be treated the same as ['Test', > 'Func'] or 'Test::Func' until it is called and if some fancy framework > wants to do something special with the closure, it can do so. FWIW, I > didn't even know this syntax checked anything until today. I can think > of a number of cases where delaying the error to actual execution is > beneficial. > > 1. Just because the method/object doesn't exist, doesn't mean it won't > exist by the time it is called -- this is PHP after all. > 2. I can have a file with 100 million of these things without > triggering any autoloading. > 3. PHPStorm currently doesn't trigger this syntax as an error. This ship has long since sailed. Test::func(...) produces a \Callable object, using the Closure::fromCallable() mechanism internally. One important advantage (and why Nikita favored it over most other callable syntaxes) is that it respects scope visibility better than passing around a buncha strings. Changing that at this point is a major API break that is not going to happen. --Larry Garfield