Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124761 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 AA19E1A00B7 for ; Mon, 5 Aug 2024 12:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722859398; bh=klAq0iQJ8GCqQZRRlb1fsbY1X/lhupFSe5VhlvZVgVI=; h=Subject:From:To:Date:In-Reply-To:References:From; b=NTJw6vA1XbW0vaOX4A+JWTWV6Saoal+rjLuJs+5bXR8WUV3xTfk99Ffv8j5wnVbHR QcwPMEWTPX8dscP9047C1aRN7ITqwHTf9fsITHzpxvmEvExxxk4UnWND7YK6tDdtx5 xSseWZF3ezFOMyvhgKFxCBVkdzBQFghNxuDGy8ZKD5V5BQDkgBghrtvXcTCHvxtxBI m5LIqGN0FJZarkJcaPNoMXVnZTWrhXa8HKO45PTxAC6sWNQsE2huQ4z4tbPzvkDFp+ IEHOgIZwmV++x+Isxza1CMLTUZLw2V4lBpRgcWeNMDQC4/MUqnJyAiEZb2IHl0RgEg 3S8X9A/JIa+2Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D8E9C180055 for ; Mon, 5 Aug 2024 12:03:17 +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.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from ageofdream.com (ageofdream.com [45.33.21.21]) (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 ; Mon, 5 Aug 2024 12:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ageofdream.com; s=ageofdream; t=1722859295; bh=klAq0iQJ8GCqQZRRlb1fsbY1X/lhupFSe5VhlvZVgVI=; h=Subject:From:To:Date:In-Reply-To:References:From; b=s9tzMYYNBlmIcNwBdHs3Hu7V6/ABeuEm4bLQVrSC0WE2Zjy9XhLCM/MEJzH6t2kcR etGlFOtZy6oSLLZSgT9BEHJ1KmQg5A+ymCsme+pxN0AGpomf/fCXsDMHYzwn7XWICM WthXbRVOGJrbu9tEewknlVeqw4BxoiC1W71p2wvZl+uVQb1ecrFShtTzBhHUsBN2Yi 14mnEosLW2Xp22kFmVE9r2x6Zcp4m6mQndxEsQS9naVILdAqAmVyWKCdRICABq8Hlw mYrqz6smUvIRaOKtuV88GbZUq0rvMVKB5EOIR/G+4bw22cz6wgO0TCkuFnTh3IMZMx o9cBdIj7jfX0w== Received: from [192.168.1.7] (unknown [72.255.193.122]) by ageofdream.com (Postfix) with ESMTPSA id 75CBC2746E for ; Mon, 5 Aug 2024 08:01:35 -0400 (EDT) Message-ID: <519bd3144e5b99a57d5d411a99dcdc0077261c33.camel@ageofdream.com> Subject: Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global To: internals@lists.php.net Date: Mon, 05 Aug 2024 08:01:35 -0400 In-Reply-To: <0e04da48-0d16-f5d5-29b3-b43271d0d0d2@php.net> References: <0e04da48-0d16-f5d5-29b3-b43271d0d0d2@php.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 From: lists@ageofdream.com (Nick Lockheart) On Mon, 2024-08-05 at 12:27 +0100, Derick Rethans wrote: > On Sun, 4 Aug 2024, Nick Lockheart wrote: >=20 > > https://wiki.php.net/rfc/global_function_parser_directive=C2=A0I am > > asking=20 > > that we discuss and vote on the following question: > >=20 > > =E2=80=9CShould there be some way for developers to signal to the parse= r at > > compile time that all unqualified function names found in a > > namespace=20 > > context are global, without a namespace lookup?=E2=80=9D >=20 > I don't beleive that we should introduce a switch for this at all, > just=20 > like the conclusion was in > https://wiki.php.net/rfc/use_global_elements >=20 >=20 In that RFC, the proposal was: declare(function_and_const_lookup=3D'global'); I'm not sure the conclusion was that there shouldn't be a way to control the NS lookup behavior. That's what I'm trying to determine with this new RFC: whether it was the entire concept, or just the syntax or mechanism that was disfavored. Do people agree that there should be=C2=A0*some way* to use only global functions without an NS lookup as a *concept*? Or, did they not like the syntax of: declare(function_and_const_lookup=3D'global'); ? Because that RFC has four things in it: (1) A Concept that global functions should be used without an NS lookup (2) A Concept that global *constants* should be usable without an NS lookup. (3) A syntax being proposed. (4) The idea that functions and constants should both be controlled by the same directive. I think that other RFC was on the right page, for the most part, but I think the syntax could be improved. Which is why I had suggested a new keyword as part of the namespace declaration in some of my other posts. Something that would look like one of these: // Disable NS lookup; use all *global* functions unless // a \foo\ appears before the function name: namespace foo using global functions; // Disable NS lookup; use all *local* functions unless // a \ appears before the function name: namespace foo using local functions; // Use NS lookup. Same as today, no BC break: namespace foo;=20