Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125150 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 07C401A00BD for ; Fri, 23 Aug 2024 16:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724431034; bh=WFyGIyhV4GFKyAQAOiV7FfSwLwilFx4LZL1vMvvzSNg=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=K93XdiSk40f/uN17Ua3CetytLZtVVABoAVZgaS6qaDW6ifcvSyvF0sOO96fMFOG4Z 2PF6Yldo55kN3vjsC4d8iIvYNx+EARhENl3aEfc2sS2HfTXt5dY+JCuTZeSJJyysb7 +N49uI3Ugjajd4bosdDNjyrlJsiMqFWdOAMUxJA3Hm01Ixiy6PscCxqvCL1QM7P5rP vW+iy3CtbNqsZEoxO9/JOOesJl9ikSIPkJk8a/EkXNOQ47Y4sVe37XH0Jsu1UDAW2a O1oaSXXCqyFSYpONFAWSGbGr5pd4MVKdHUQOsdtedkg17Tf2GoIny4z+EzVr7F9rCc wKi1kQxHpS7XA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 529D2180052 for ; Fri, 23 Aug 2024 16:37:14 +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.8 required=5.0 tests=BAYES_50,DMARC_MISSING, HTML_MESSAGE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail1.25mail.st (mail1.25mail.st [206.123.115.54]) (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 ; Fri, 23 Aug 2024 16:37:14 +0000 (UTC) Received: from smtpclient.apple (unknown [49.48.221.224]) by mail1.25mail.st (Postfix) with ESMTPSA id B52D9604A3; Fri, 23 Aug 2024 16:35:15 +0000 (UTC) Message-ID: <828A2555-E7CC-4DD8-AE1B-8D50EB7EDC6F@koalephant.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_DF43A101-50DF-416E-9305-1CDEAC018520" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local) Date: Fri, 23 Aug 2024 23:35:02 +0700 In-Reply-To: <48F2A153-D33C-47CA-AB0A-67B85258D8E9@getmailspring.com> Cc: "Rowan Tommins [IMSoP]" , "internals@lists.php.net" To: John Coggeshall References: <63DAE337-B117-4380-8735-186DC30FE0B7@rwec.co.uk> <48F2A153-D33C-47CA-AB0A-67B85258D8E9@getmailspring.com> X-Mailer: Apple Mail (2.3776.700.51) From: php-lists@koalephant.com (Stephen Reay) --Apple-Mail=_DF43A101-50DF-416E-9305-1CDEAC018520 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 23 Aug 2024, at 23:13, John Coggeshall wrote: >=20 >=20 >=20 > On Aug 23 2024, at 11:49 am, Rowan Tommins [IMSoP] = wrote: >=20 > And most users don't object to using a leading backslash, they just = (quite reasonably) have no idea what impact it has on the ability of the = engine to optimise their code. >=20 > I think this is a misread, and I don't think you can argue that there = is a clear understanding of "most users" here. While I admit I too don't = have real data to back this up, I would be more likely to believe "most = users" would absolutely object to being forced into using a leading = backslash and would find it non-sensical that you must add a backslash = for the engine to do the "right thing" (in this case, optimize their = code with a security benefit), vs just doing the right thing by default. >=20 Hi John, Now please don't misunderstand me, I am not advocating for a change to = drop the fallback to global symbols. I wouldn't be against such a change = but I don't think it's a problem that needs to be solved right now. But if that were the proposal, I have to ask about something you said: > would find it non-sensical that you must add a backslash for the = engine to do the "right thing" (in this case, optimize their code with a = security benefit), vs just doing the right thing by default.=20 What do you mean by this? What is "the right thing"? Are you saying that you think people would expect an unqualified = function name to automatically act like a global function name, and = never check for a local namespaced function of the same name? Just to be = clear, you understand that is the literal opposite of how = classes/traits/interfaces work in PHP, yes? I'm not saying that isn't necessarily how people think, I have literally = zero data about this besides my own thoughts, but it seems like a = bizarre idea that people would *expect* function name resolution to work = completely opposite to how class/class-like name resolution works. Cheers Stephen=20= --Apple-Mail=_DF43A101-50DF-416E-9305-1CDEAC018520 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On 23 Aug 2024, at 23:13, John Coggeshall = <john@coggeshall.org> wrote:



On Aug 23 2024, at 11:49 am, Rowan = Tommins [IMSoP] <imsop.php@rwec.co.uk> = wrote:

And most users don't object to = using a leading backslash, they just (quite reasonably) have no idea = what impact it has on the ability of the engine to optimise their = code.

I think this is a misread, = and I don't think you can argue that there is a clear understanding of = "most users" here. While I admit I too don't have real data to back this = up, I would be more likely to believe "most users" would absolutely = object to being forced into using a leading backslash and would find it = non-sensical that you must add a backslash for the engine to do the = "right thing" (in this case, optimize their code with a security = benefit), vs just doing the right thing by default. =


Hi = John,

Now please don't misunderstand me, I am = not advocating for a change to drop the fallback to global symbols. I = wouldn't be against such a change but I don't think it's a problem that = needs to be solved right now.

But if that were = the proposal, I have to ask about something you = said:

would find it = non-sensical that you must add a backslash for the engine to do the = "right thing" (in this case, optimize their code with a security = benefit), vs just doing the right thing by = default. 

What do you mean by this? = What is "the right thing"?

Are you saying that = you think people would expect an unqualified function name to = automatically act like a global function name, and never check for a = local namespaced function of the same name? Just to be clear, you = understand that is the literal opposite of how classes/traits/interfaces = work in PHP, yes?

I'm not saying that isn't = necessarily how people think, I have literally zero data about this = besides my own thoughts, but it seems like a bizarre idea that people = would *expect* function name resolution to work completely opposite to = how class/class-like name resolution = works.


Cheers

=
Stephen 
= --Apple-Mail=_DF43A101-50DF-416E-9305-1CDEAC018520--