Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125066 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 qa.php.net (Postfix) with ESMTPS id A412B1A00BD for ; Tue, 20 Aug 2024 09:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724144626; bh=9SeETQG1bafi5zBaDeBRJ6Lb9TUFWTYlguEen3XTl2M=; h=Date:From:To:In-Reply-To:References:Subject:From; b=NvQO482RDUZhUOORPBK+nkyxhU7EA9OUinFRFGYGVYt6zne7Hx7KbgEYnRIypTxJG hLL64ydi4xDIMH/ddogYoKZ4ffig1nRlZliBQYoR0Pys1X4dFCpY40sO2kgJoK1Ywx fdY9eZKB+9IQccN036SLavQKUxseG+4KcZR547QEab5wfKY4LQBdtdKEsP9frSvyYC ahrNEFBW/vBqNZObW/sPwkXk6thkwPXuYdI8OJszoQyxuo3OoSgpP23x8iSlD+tzYq /VLJE1G/bxbmDoobSY4Cgyus7VdP3drBP0w2SXTYCrxZWA8Bk9Oqf9OvjNB1WSVCa2 luE9wvnC50y9g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D837318005C for ; Tue, 20 Aug 2024 09:03:45 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (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 ; Tue, 20 Aug 2024 09:03:45 +0000 (UTC) Received: from phl-compute-02.internal (phl-compute-02.nyi.internal [10.202.2.42]) by mailfout.nyi.internal (Postfix) with ESMTP id B4F1E138FF6D for ; Tue, 20 Aug 2024 05:01:55 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-02.internal (MEProxy); Tue, 20 Aug 2024 05:01:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1724144515; x=1724230915; bh=/T5HKQsqdw 3FC7d1A6Fc8KtYj+3prQ60Kz3qLVuyTeQ=; b=NCmkp/NFif4UfZh0ncfwok3seN rQ2QWyKNtQR+HmgOQH86AcONlcXEXt7KjKvWa7LY1LiA/Ygmxa3/bad72DisoD+T /im8IVkdIXgHZxDYBYwNV7fEvv0XCOILFSS0X4Iihn8Dv8ptn0xcd/+L/aRcu0cL mbas24TvIBPBlgL43q/R/jF5UFQnRVgy9XErU+dqs6uyJUHISLG5tCE2JHNiZItf iun8qTJzZWQA2YNU8tN26er2/K341JjUOXAdlHKaPiHhEJuEoNp9fFwvreV2eSjh 910Xt0x/R+EdQhB4KAxj6nCtjDQ7r2Ml8onPBYlQiwcnALvw38vkeTk4yPMQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1724144515; x=1724230915; bh=/T5HKQsqdw3FC7d1A6Fc8KtYj+3p rQ60Kz3qLVuyTeQ=; b=DDWxcZMAN+bde7jPW9sf+W3htP6efjrI86OZF6WFNGa4 buo9AmfrUGwd+v1ijMJLFSAVbYHBiAtrdinagtXuud77wX5e5ma2Vy01vhlfJdea YJq4OeHnUy8MKBBIGHjlQ5eyLYK/8Isxaz5ASS5AFdp3pGSMkworpYq18BqxqO5r NFdKpsplstkW4AAlkLebB9Iuk+CufwPY7u1/EODy1/qRD777ix5tA8z4+4dGU/iP 1EDE50tCUpLIjc1UWYrI04pCLdZawoiJYd3VQAX3Iiir+J+JuQ4kKUqkmU29pwcn gJjCjFIMnTCsByWGScDiW40AZQhSdd8SP5VPESvmVQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudduiedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefoggffhf fvkfgjfhfutgesrgdtreerredtjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcu oehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrghtthgvrhhnpedtueejtd ethfeulefhtdelieduteelffdtudelheffgedtieehhfelieejgfevgeenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgssegsohhtthhlvg gurdgtohguvghspdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgt phhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5FD5C15A005E; Tue, 20 Aug 2024 05:01:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 20 Aug 2024 11:01:34 +0200 To: internals@lists.php.net Message-ID: In-Reply-To: <095f08ad4406a2166b3c5ddf472959daceef6502.camel@ageofdream.com> References: <095f08ad4406a2166b3c5ddf472959daceef6502.camel@ageofdream.com> Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local) Content-Type: multipart/alternative; boundary=ef75ea3718744f47819394c53f15de77 From: rob@bottled.codes ("Rob Landers") --ef75ea3718744f47819394c53f15de77 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, Aug 20, 2024, at 10:41, Nick Lockheart wrote: >=20 > > We would upgrade that to a warning in PHP 9.2, and it would end up > > being an error on PHP 10 and have a BC break. > >=20 > > I don't think adding a \ to each function call is ugly, that's what > > we have for classes, and it works fine; or an use statement. > >=20 > > So, why do we think that after people get used to it, they would > > still consider it ugly? Never heard the "ugliness" mentioned for > > classes. >=20 >=20 > Respectfully, I think `\` is ugly for both functions and classes. >=20 >=20 > > Now, I know this would be a big BC break, but it brings consistency > > to the language and forces everyone to improve their code > > performance. >=20 > There should be a directive for this, like: >=20 > namespace foo using global functions; >=20 > ...which automatically acts as if all functions have a \ in front of > them, unless they are fully qualified. >=20 Respectfully, I feel like this gets into the heart of a problem with RFC= s, where if someone wants to implement something, they have to solve eve= ryone=E2=80=99s problems. In this case, there is a problem with performance issues due to multiple= lookups (though, I=E2=80=99m not convinced fully), so if someone wants = to implement function autoloading, they also have to solve this problem = (Gina and I have both independently solved it in various ways). Personally, I=E2=80=99m of the opinion that if you want performance, you= know what to do: fully qualify your names. If you don=E2=80=99t care (w= hich is what I gather from the first email in this thread where maintain= ers were not willing to change their code), then =E2=80=9Cdeal with it.=E2= =80=9D The vast majority of performance issues won=E2=80=99t be caused by funct= ion lookups, but by databases and poorly written code. Maybe I am wrong,= but I rather like what we currently have, whatever benchmarks have to s= ay on the matter.=20 =E2=80=94 Rob --ef75ea3718744f47819394c53f15de77 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

=
On Tue, Aug 20, 2024, at 10:41, Nick Lockheart wrote:
=

> We would upgrade that to a warning in PHP 9.2, and it would end up=
> being an error on PHP 10 and have a BC break.

> I don't think adding a \ to each f= unction call is ugly, that's what
> we have for classes= , and it works fine; or an use statement.

> So, why do we think that after people get used to it, = ;they would
> still consider it ugly? Never heard the "= ugliness" mentioned for
> classes.
<= br>

Respectfully, I think `\` is ugly for both = functions and classes.


> = Now, I know this would be a big BC break, but it brings consistency
<= /div>
> to the language and forces everyone to improve their code=
> performance.

There shou= ld be a directive for this, like:

 &nb= sp;  namespace foo using global functions;

=
...which automatically acts as if all functions have a \ in front o= f
them, unless they are fully qualified.

Respectfully, I feel like this g= ets into the heart of a problem with RFCs, where if someone wants to imp= lement something, they have to solve everyone=E2=80=99s problems.

In this case, there is a problem with performance= issues due to multiple lookups (though, I=E2=80=99m not convinced fully= ), so if someone wants to implement function autoloading, they also have= to solve this problem (Gina and I have both independently solved it in = various ways).

Personally, I=E2=80=99m of t= he opinion that if you want performance, you know what to do: fully qual= ify your names. If you don=E2=80=99t care (which is what I gather from t= he first email in this thread where maintainers were not willing to chan= ge their code), then =E2=80=9Cdeal with it.=E2=80=9D

<= /div>
The vast majority of performance issues won=E2=80=99t be cause= d by function lookups, but by databases and poorly written code. Maybe I= am wrong, but I rather like what we currently have, whatever benchmarks= have to say on the matter. 

=E2=80=94 Rob
--ef75ea3718744f47819394c53f15de77--