Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124735 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 B9C5E1A00B7 for ; Sun, 4 Aug 2024 12:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722774321; bh=EBKpZH3YanALbb6cUUleWyxrBvjsAliWnH6ZPzkz+RE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Y4El+VdlRSvOSzeRs00xQAihTX6B7TV4wQhJAivBzbtB/iO/YgdDdK+RgHYk/s6wi NJAHXXua9fs6OOwguykVaMgH2oKQGA58Qe3Oc9C/DR92l5jyGYXTkkKYgYracQB/qh W6AmP/8gUa1dOZBb/gqqKgiUiPfEa9iZ0pxNW0qCwVR8WUKWikvSxjdSIrgJi/5OYB Y52WK23IAdHcsumQ3LS/j06b8U59HWJw21CkM6WXQb4ZybzICdI57pCDAmPdScd3wU IEUJpmhnBu00VKDQb1lb9qXmAucPb5tvxswOrr2b0kUgWCoXcvHsyjL8an5ktOzu9P 3iYcgwqZ72SZw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1CDB6180055 for ; Sun, 4 Aug 2024 12:25: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.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-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (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 ; Sun, 4 Aug 2024 12:25:17 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7a1d48e0a5fso5519850a12.3 for ; Sun, 04 Aug 2024 05:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722774216; x=1723379016; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EBKpZH3YanALbb6cUUleWyxrBvjsAliWnH6ZPzkz+RE=; b=E1fzw/blKBIO097QsuPXHRdLrpfcKT1ZRNPIYT1TTixbonTt9e5BJQwIlBpemIXtDz 1Zcdh7pO0/HWNOis0SntamAuu9zTSaCxwOhvN5qWxpC20ePUSN2Ash3O13diqJFOJGAs lopttMvH7oSHWUSOphJxMoCzO9GEWTRtOH9skMDGiUQ0uY7DFCWT0+enUo9KQFFpa3Ka 3ymVjH6g6R4V7gzs81/ZaeEtzA25WZ1HbogiXWG1/u0WVB/Teh3IRVCreBPZc4ydIPv9 hp3n/pz9Xt9JXDKwXU1zDDvHs7+8SAdJEHZGVKYiVV2vvpNq+WdRUcdPB+IizP56gOQy rELQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722774216; x=1723379016; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EBKpZH3YanALbb6cUUleWyxrBvjsAliWnH6ZPzkz+RE=; b=Ed6qfifVg7rg5m4VDsQdAZn+HYEJ30ohevJStybynLhIxucbqjEXs83nw+klVftEbN nF1c1y8MF+O5kGO3SMeNrIxUyPPkVh224+0flc4Of+u6C0A9+3188T8pCgNnp1Uv8d0n 2sSWWr+zVqqr3RnC6ELNLOG1vhSdfNy+eAInnUQy2UChvRCNH3Y2Oo5bmjeOZcetHObS Rs6XEEmVSiX/UHQ00x/IIVf7RdcpMyWuKU5Aj5+epW8svkmCgCeSbveUFzgdCjbCeRSz uMo8hXRnTxJmIGT7B+08P8i5hp4cOUQq1L8WYXGi+9adS05YabOgInqj0Xfp6COZp7iQ 3K+A== X-Gm-Message-State: AOJu0YxGNpns+ACnAEBU2xgE0bnGpx8X2R8O7OxheDM4S0pybXtfVHqc /H+e7lQY8VbqizpfOlfu2ASXg0DLRRfKhOu58+W1KOuIDKUE2p4DM3olZVqo9korFVJTwtUgifk XHK3ZMbyh/sahVjhJmIjVa1akKWgUhysH9ng= X-Google-Smtp-Source: AGHT+IFdURXP8VxqyCHDLHaJJAZj8rIv0dhlvXBqtqaEzaP4ZfXSzVT/KPY3H0CvW3EH3TIaZByIstTmODFJNA+trx0= X-Received: by 2002:a05:6a20:430d:b0:1c0:ebca:eaca with SMTP id adf61e73a8af0-1c699555468mr10415038637.12.1722774215872; Sun, 04 Aug 2024 05:23:35 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1a88918e-e808-d778-45e1-53797660e093@php.net> <3563cf9b-8eab-4c82-b525-a5d2f9a767bb@varteg.nz> <38920A4B-790D-48C7-B2F6-C49D3F506232@rwec.co.uk> <0824789d-0e36-4628-85c1-4b8d9b7f86af@varteg.nz> <2244a37f-8c51-448d-8a56-329ff32e6470@bastelstu.be> <0e1a21ddef3c7da17a3539b92d5f442763f4b1f8.camel@ageofdream.com> In-Reply-To: <0e1a21ddef3c7da17a3539b92d5f442763f4b1f8.camel@ageofdream.com> Date: Sun, 4 Aug 2024 14:23:23 +0200 Message-ID: Subject: Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global To: Nick Lockheart Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000002a56b7061edaa19f" From: ocramius@gmail.com (Marco Pivetta) --0000000000002a56b7061edaa19f Content-Type: text/plain; charset="UTF-8" Hey Nick, On Sun, 4 Aug 2024 at 13:42, Nick Lockheart wrote: > This also prevents the parser from using dedicated opcodes for built-in > functions. > > This incurs a performance penalty. > For many, many years, tools like `doctrine/coding-standard` have imported global functions. The performance benefit is minimal and opt-in at very minimal effort for userland (literally "run a decent coding standards tool"). Changing this behavior breaks use-cases like shadowing internal functions, which are useful for testing / stubbing / etc. I disagree with the technique, but it is a valid and relied-upon use-case nonetheless. Better ways forward: * endorse userland to use a CS tool * namespace performance-sensitive PHP functions, so we can exclude the entire problem, by having people use the namespaced variant :P Marco Pivetta https://mastodon.social/@ocramius https://ocramius.github.io/ --0000000000002a56b7061edaa19f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Nick,
On Sun, 4 Aug 2024 at 13:42, Nick Lockheart <= lists@ageofdream.com> wrote:=
This also prevents the parser from using dedicated opcodes for built-in
functions.

This incurs a performance penalty.

For = many, many years, tools like `doctrine/coding-standard` have imported globa= l functions.

The performance benefit is minimal an= d opt-in at very minimal effort for userland (literally "run a decent = coding standards tool").

Changing this be= havior breaks use-cases like shadowing internal functions, which are useful= for testing / stubbing / etc. I disagree with the technique, but it is a v= alid and relied-upon use-case nonetheless.

Better = ways forward:

=C2=A0* endorse userland to use a CS= tool
=C2=A0* namespace performance-sensitive PHP functions, so w= e can exclude the entire problem, by having people use the namespaced varia= nt :P
--0000000000002a56b7061edaa19f--