Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125165 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 02D2F1A00BD for ; Fri, 23 Aug 2024 19:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724442215; bh=FxcThJZ7ucrUHF2jIpmgPeDYwRnkLph2tFnN309XNQA=; h=Date:From:To:Subject:In-Reply-To:References:From; b=Rfbtf7RuLyWGJzMtBm201fmPo8YT1BT9qiDssnIW+mIsZ2IqpmdiiIAuEr8FrbaH6 NcUY8lW0QiC44aVGqE5Z3CYoKDR2EGlDFLpcryCdaCPiWJQr2quZ+WO8+7fwB3ouhZ V2p+6rqcJa3xPxt4CW0r6e9ndx6XJdZhq71CWONCL6GN5zVDgzbhyIHM+g4BZ1wFAN WICO8dcmg+lqaFxndREnu58L8B4gVoPXn8ERK7xXN44sr6yeskauKjsQbEeWlREd40 2z3l8VpAXGVltTEt2jJxi8jP8ssOFlBsCCbzZX2t7929zIcRGsd3bnPeGW6+K7r8Q6 /My8kGXuWPA7A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F2E5D18068E for ; Fri, 23 Aug 2024 19:43:34 +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,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 fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) (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 ; Fri, 23 Aug 2024 19:43:34 +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 F28F4138FF54 for ; Fri, 23 Aug 2024 15:41:42 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Fri, 23 Aug 2024 15:41:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding: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=fm1; t=1724442102; x=1724528502; bh=FxcThJZ7ucrUHF2jIpmgPeDYwRnkLph2tFnN309XNQA=; b= FpKC/YP3hgHthpeL96fLL/Cf3I1/D3G7RcFlgqwvWf+uahI3LT5XKlVZJWOtsc1X NPT/sFvjQDqA0lyvCKQw2sa71u8MgCEiVfaaV31H0I6VWJDu0YP4iC44PqkwrYgw ia5WdUETxcgCAJppt+eG6rZmEPSHvqz/b5ivrPXdHbhujIudtUx5XgHDMIpnYCZw w+kLihPKndGNCHUEvQgio1TkBQcSe0YkWkQv0powA8ePO+hM3nPDm8/B6fCWQLO5 KDG0958cyl9ZNnIJuMqha/8/BPFQrzVTFEjeMRg4zsAhj0vgPsLfdB2n4foJxE+N XTK82iXtd/Jlh8zg+9Stew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=1724442102; x= 1724528502; bh=FxcThJZ7ucrUHF2jIpmgPeDYwRnkLph2tFnN309XNQA=; b=a I5+BAUYBVLSACbx613XbYlql89+CkkthGvDuwY/aNBArGfZ68SWXST8clcnWt+8S iMnfvZ96TA5HgTC3kaBGwh0d03IS+2l/tR3L/fctqeWTkGJgOM+pcQIfT9/qGlcr sOCHmWLVy6oIwX5FbWUBaxP97i6nGv3HbLS7hZvJeuCIfq9LmDxsbWOFeRGLpD0Z XnCTYSOvy4K4pztVSL2+xNd+bxuSoQX3Dfo3b3VfKYz8GIEz+s2/NXpb+H4ImfKq bgf45Yz9l+lu1YbqxlVonkJFQnzayj+kvdJBz/nuEOQ96Pwb/ioSiaOIL8O1oAYB 83wIQsqeTcb9kldYwIAYw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvvddgudeflecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvf fufggjfhfkgggtgfesthhqmhdttderjeenucfhrhhomhepfdftohifrghnucfvohhmmhhi nhhsucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqne cuggftrfgrthhtvghrnhepheelffetiefgveduteefudegtdduveeludegueegleehiefh hefgtdekveevgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepihhmshhophdrphhhphesrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthho pedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlih hsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 23 Aug 2024 15:41:42 -0400 (EDT) Date: Fri, 23 Aug 2024 20:41:41 +0100 To: internals@lists.php.net Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_=5BConcept=5D_Flip_relative_fu?= =?US-ASCII?Q?nction_lookup_order_=28global=2C_then_local=29?= User-Agent: K-9 Mail for Android In-Reply-To: References: <21D6F160-5EAE-44FA-907B-E1DAAC1B8D75@rwec.co.uk> <53BD062A-4D7F-4E5D-852E-6D27641213A8@koalephant.com> <7607FD64-5572-466E-9866-63C2536B2A09@koalephant.com> <0d269a38-28fe-494c-a903-50022e09f27b@app.fastmail.com> <63DAE337-B117-4380-8735-186DC30FE0B7@rwec.co.uk> Message-ID: <977227E3-8793-4FB1-B572-B75D27C06ED5@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 23 August 2024 18:32:41 BST, Ilija Tovilo = wrote: >IMO, 1=2E is too drastic=2E As people have mentioned, there are tools to >automate disambiguation=2E But unless we gain some other benefit from >dropping the lookup entirely, why do it? I can think of a few disadvantages of "global first": - Fewer code bases will be affected, but working out which ones is harder= =2E The easiest migration will probably be to make sure all calls to namesp= aced functions are fully qualified, as though it was "global only"=2E - Even after the initial migration, users will have to watch out for new c= onflicting global functions=2E Again, this can be avoided by just pretendin= g it's "global only"=2E=20 - The engine won't be able to optimise calls where the name exists locally= but not globally, because a userland global function could be defined at a= ny time=2E - Unlike with the current way around, there's unlikely to be a use case fo= r shadowing a namespaced name with a global one; it will just be a gotcha t= hat trips people up occasionally=2E None of these seem like showstoppers to me, but since we can so easily go = one step further to "global only", and avoid them, why wouldn't we?=20 Your answer to that seems to be that you think "global only" is a bigger B= C break, but I wonder how much difference it really makes=2E As in, how man= y codebases are using unqualified calls to reference a namespaced function,= but *not* shadowing a global name? Regards, Rowan Tommins [IMSoP]