Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125178 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 D1A871A00BD for ; Sat, 24 Aug 2024 11:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724500582; bh=PpSIJGtqJgrgeHc/dH+8bXpEN+y+n5bbPfahAxGjhMI=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=nxi/vF9kp4bPQ8VJbtvUyhmM0Un+KvSVgZfIaFwtW9kYEIluYzMUWPVOlNSiIFYVj ByIuenV3D06FxlBBEjkvSzDrjZO69I84Iyn+DfSbYmRdElIySv2a4hfenj0WRaCG4n hVxBnJtxatjmJj7hDIz6Dz7DBRVZVAmZd2UBP0SA9hbjb15xPmUO4HvviO/RZWM9sg NhgtVbI7GOu42ZsrJ+gTQIEdmjxRx6jRNzYHt8K45vkoV/c/OEXNR1gePIqC6JH658 x+nDrdRRWMaSbn+lgdpi6QER2Rdi6bXJScFmgZCacAtaGn+3InY3TJu+2F39bKoiio gR6PG67QFBTrA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 66FF3180062 for ; Sat, 24 Aug 2024 11:56:21 +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, 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 ; Sat, 24 Aug 2024 11:56:20 +0000 (UTC) Received: from smtpclient.apple (unknown [49.48.221.224]) by mail1.25mail.st (Postfix) with ESMTPSA id D1A0560587; Sat, 24 Aug 2024 11:54:22 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local) Date: Sat, 24 Aug 2024 18:54:09 +0700 Message-ID: <181C78B1-65AD-44B4-AD95-A59791B7FF86@koalephant.com> References: Cc: PHP internals In-Reply-To: To: Ilija Tovilo X-Mailer: iPhone Mail (21F90) From: php-lists@koalephant.com (Stephen Reay) > On 24 Aug 2024, at 01:29, Ilija Tovilo wrote: >=20 > The "hard to come by" part is referring to the engine, which is quite > optimized for the current semantics. Some of PHPs quirky semantics > make it hard to improve it further, this being one of them. Thanks for clarifying. Out of curiosity, how much optimisation do you imagin= e would be possible if the lookups were done the same was as classes (ie no f= allback, names must be local, qualified or imported with `use`)? I am aware this is a BC break. But if it's kosher to discuss introducing a n= ever ending BC break I don't see why this isn't a valid discussion either. I= t would give *everyone* that elusive 2-4% performance boost, would resolve a= ny ambiguity about which function a person intended to call (the claimed sec= urity issue) and would bring consistency with the way classes/etc are refere= nced.=20 Cheers Stephen=20=