Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124725 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 33D7D1A00B7 for ; Fri, 2 Aug 2024 19:02:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722625422; bh=Tfu215zePTR/9e5Of777+r5wFvSZ+gc0XdI9neKDvxs=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=f+MKP+FkVtO/USt7wkm0jg5zB/NbKK8N7Vzfd6vrwco3uoQSUJ/lGA3967jWC8P76 HjRjwIy8ltKvcc+ZyG+SyGX91pte/RFKQnoTpy4CXuUG8Ur9m0oeD8Nuyj/O9OvikZ K4NTpRXTxBkUdvhZ2wsGZHEcw7mDWwBkU1yAkaRKmbO61HJ7KqHQtUkXb7yO7oGI4q uwtstEs8wKbU0psKDuSkn6ZE3wX9++fezPSXGLJdB9f0ygeGTsqzy40SiKa0rB3u/T 5skWNVrM2lkwMLydp+n7LzwWhU7esPCDKbYxAI/MUertfNgLtr9GRUrp/XpKLTNSeM z8C1MajukoypA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ADB3A18005C for ; Fri, 2 Aug 2024 19:03:41 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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, 2 Aug 2024 19:03:41 +0000 (UTC) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-428178fc07eso53121745e9.3 for ; Fri, 02 Aug 2024 12:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722625320; x=1723230120; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=iNWX4+BWBXIaySziOQXYO5VnNXYUHUl6MEuSzkBmTCk=; b=gueg3N8gUkJGXTVMadLTxBUx/Rb60GuEHtxYkSIINMZWhDurE+OIcSN6dSPHX4Y76D 2Xb0u+/PYmNZuas7JvcIeM2RuPPQWVo5O2WV62839rKvOu1T6ZvCmzkcpnPNWrCUfdZe E1ekza/8gVsKjojbK4o8hmg4PD6RPXpQiiqHq0i4Rgn2ZWDreVGhxddAJDudfZKCxobE yyd59ImH7JlC+J+GhHYFVYg338ViY4jAi0nqz8NsW5aT+0cEe1hXUbxaS3Lc4hV+Nw91 tD5FRYNFsMhHmJb/gA0YT67MUVsp7jOJAh/7XVascscWGM46o3Oha+cC5ZFCicNBD825 tfnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722625320; x=1723230120; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iNWX4+BWBXIaySziOQXYO5VnNXYUHUl6MEuSzkBmTCk=; b=v6c0tc4kcrfGeXYVAPZ4TqIDDjRD6p1uQrSOk79hHvQzrjpuShwsiyob+oes+N3wJ5 iEs5sE0zdtM3alrP2DsGSIGd6FTworgMcKWBsm0JjFWLlDDpe/G88HOZQURFteCgFRcW bgo0ArFhnK5FcQKFMZoW0ymefriN6VDSvR1ao8cKP8nosQUbROMkkz6Z6DkCHDnjlE3E EXQM10Kc6Ny+eXQ8GQlHuhPuMsbv98ybOPiiJ+JMT4sOXW7ywi7dMeLSSY/ZzPferjRO yNRDXzXrr4xcm9T/vIZ+cHlbLXnFW2hEvOIXzhD3UnyHO+vuqKkCF8lKf8r1Oxg7F17i C11A== X-Gm-Message-State: AOJu0YwE562qrF65ntl2HRaQPenRWWQ1vlU62khIUdEbDBHuJHk8HlPU AMH9AbMkrZ0FtvfLyRs+ODnIorRERzypOXzn2NOy/2MT6BS9r5ls X-Google-Smtp-Source: AGHT+IFXxxF3kO3LdaK45NTArFua7GqfzCpmS/TmtZDJrrFYU//Ei21mJk/Yda9fB9wXGz+JNRC/3A== X-Received: by 2002:a05:600c:1c83:b0:426:64a2:5362 with SMTP id 5b1f17b1804b1-428e6af4bbemr32948915e9.8.1722625320015; Fri, 02 Aug 2024 12:02:00 -0700 (PDT) Received: from smtpclient.apple ([178.197.198.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e6d7ce50sm42362935e9.9.2024.08.02.12.01.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Aug 2024 12:01:59 -0700 (PDT) Message-ID: <18D4B0E8-F71F-4FCD-87E1-E5E3C4CA5068@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_5D381B5B-D4BD-45CD-83F1-C36A48D4E301" 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 \(3774.600.62\)) Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local) Date: Fri, 2 Aug 2024 21:01:47 +0200 In-Reply-To: Cc: PHP internals To: Ilija Tovilo References: X-Mailer: Apple Mail (2.3774.600.62) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_5D381B5B-D4BD-45CD-83F1-C36A48D4E301 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, I propose the following alternative approach: * establish a restricted whitelist of global functions for which the = performance gain would be noteworthy if there wasn=E2=80=99t any need to = look at local scope first; * for those functions, disallow to define a function of same name in any = namespace, e.g.: https://3v4l.org/RKnZt That way, those functions could be optimised, but the current semantics = of namespace lookup would remain unchanged. =E2=80=94Claude --Apple-Mail=_5D381B5B-D4BD-45CD-83F1-C36A48D4E301 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi,

I propose the following = alternative approach:

* establish a restricted = whitelist of global functions for which the performance gain would be = noteworthy if there wasn=E2=80=99t any need to look at local scope = first;

* for those functions, disallow to = define a function of same name in any namespace, e.g.: https://3v4l.org/RKnZt

That way, those functions could be optimised, but the current = semantics of namespace lookup would remain = unchanged.

=E2=80=94Claude


= --Apple-Mail=_5D381B5B-D4BD-45CD-83F1-C36A48D4E301--