Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120102 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96252 invoked from network); 21 Apr 2023 11:28:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Apr 2023 11:28:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8914A180539 for ; Fri, 21 Apr 2023 04:28:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 21 Apr 2023 04:28:08 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f09b9ac51dso46164375e9.0 for ; Fri, 21 Apr 2023 04:28:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682076487; x=1684668487; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=iry+e+aUO9wkZf1JeMHQss4N0tRgdYUnbj0L67Ecd9w=; b=JyQ94/sEedfU8AVTuNXYKvnQgYedc0m0bkVZUGqTPbJ98WEOemBp0m8nGLXtJmwR1e LpYygsK6/pZ07bJ2YCxnpQqvGjGpsBYdr+q7iLfY4HEtdxv/TIdIGeoNlZ/MLQAH5bzf V1RuQcy5b7lA2iZV0QIRIdxyuiG0AV/2C0tMg6Uh4nBvzBJq+k/Fl4/yPFsgvNeNM7Hb bIyGju3EhpuUzrZ0aGUQecYt7HxxTUC2RYWzYFRtLAQZHyXFe4Fypi0k7k17brp08isG BBr70ZO21+QOHL3z3Z35tt44GU4xqPEgYQ1v8luozkseskqyhf4ShZtz+kEHuUcBNdzK zwhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682076487; x=1684668487; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iry+e+aUO9wkZf1JeMHQss4N0tRgdYUnbj0L67Ecd9w=; b=kHM/a8Kg5rqoHyiC0TTsYa2PNYTxR0PKdUIGJXa/fKEqMTHfp+FOfEPD2cwCnHyNl/ dnsTiArY9bOHUI1Bfl2brmdoojcG9m/Ibb+JinjTy/2+u0FGnp6K0XtVvBDd9fi75enR qYl8brPSla534nSpKKY6hOqcrdhJ6O3BPcXhjReKT5GOIoTHb0ojW8qNv3SVQVIEEdxR FmT2+fbuT2EiaXAX6UckIGK3npq/pbcd87bSA8a6eoKL121dYv46t53ice9g+pqsEJ9l 2b2HWkcnm+KipMuZifeGUGglQGwrjRKUkv+pKKam4y4hWV4Cah2nrFG8fViDQntYk9T+ B8zg== X-Gm-Message-State: AAQBX9dDxEYgIm8QQQWi5uM3uTO/lGqSPaze5kbuOeXbwFGolVY0fPZr /3VqpyIrr1Yx5Z7BmvCwOlWeDIDztKs= X-Google-Smtp-Source: AKy350bHSiIHMY3xVqgFNWecENFhiK8gWKqRrYdAiA9wFCbpZDLlzPJ/XaRSvF4rhoFu7z60NgamUg== X-Received: by 2002:adf:e749:0:b0:2fa:88d3:f8b8 with SMTP id c9-20020adfe749000000b002fa88d3f8b8mr7250822wrn.12.1682076487660; Fri, 21 Apr 2023 04:28:07 -0700 (PDT) Received: from [192.168.0.22] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.googlemail.com with ESMTPSA id g18-20020a5d5552000000b002e51195a3e2sm4207030wrw.79.2023.04.21.04.28.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Apr 2023 04:28:06 -0700 (PDT) Message-ID: Date: Fri, 21 Apr 2023 12:28:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-GB To: internals@lists.php.net References: <6581c252-75c9-889d-75d2-eff5220216c2@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Expansion of PHP Symbols? From: rowan.collins@gmail.com (Rowan Tommins) On 21/04/2023 12:11, Deleu wrote: > - PHP looks up \Foo\strlen. It's not on the Symbols table. Trigger > autoload for it. > - Autoload does NOT find a definition, register in the Symbols table > that \Foo\strlen is undefined. > - PHP looks up \strlen. It's not on the Symbols table, trigger > autoload for it. > - Autoload finds a definition, registers in the Symbols table and > executes \strlen. Yep, that's pretty much what's currently being proposed. The devil is in the detail of how to implement the "register that \Foo\strlen is undefined" part. In the current implementation, there's some unfortunate side effects. > I can imagine one would argue that caching every native function with > a huge amount of namespace with a "undefined" definition could take up > some memory space, but wouldn't that just encourage the PHP Community, > PHP IDEs and static analysers to promote top-level file `use function > \strlen` Indeed, although bear in mind that the impact would be immediate on all existing code bases. Saying "all your code will be slower / use more memory in PHP 8.3 until you run this tool" is not the greatest message, so we still want to minimise that impact. (As an aside, I'd personally much rather type \ in front of functions than maintain a long "use function" list in every file, even with the aid of tools; but apparently I'm in a minority on that.) Regards, -- Rowan Tommins [IMSoP]