Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119915 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79232 invoked from network); 11 Apr 2023 13:14:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Apr 2023 13:14:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 962A318057A for ; Tue, 11 Apr 2023 06:14:50 -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, 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-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 ; Tue, 11 Apr 2023 06:14:49 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id j11so11160472wrd.2 for ; Tue, 11 Apr 2023 06:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681218888; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=5i9HWU2rPXoJ4otS5srqXeIpmDJOK27buYaDqtj6tLM=; b=mw18A3NNw6bCRPxsc6j+CvrzxkZ+s8yyq3St2F1srgB4EY9gI5AuBu+Fcdd4RXK+st f4RJnu+fvCfVtUAeGem7ZUM6qZCzsF5A1RJAZZ8OmpFyJoN9pYSIKGeOTnGpuhx78SH6 I/sy6qQn13rSl2D8L2EnIvc7Hl3hbSey1V1CB3FNvmDhKd52vD8DZ/Bo6Odi3l6gzVQe VE/W6raH2I4zSK97Svf07F/32CHZPD07zybm6y8jEv8sZdMWeHWAK61/9e7IP1bvoKr0 zTxdt+smIlIafJsR57Rgx/th5cyxkBDrMmJcyFnqleMstN6E8EZpm6MbZZXJc6uSmaQc uhVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681218888; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5i9HWU2rPXoJ4otS5srqXeIpmDJOK27buYaDqtj6tLM=; b=JNQ/QxCHFd7df83rbMd1BTBRc+B4jGlPE/GsWTIyHgO/FCRrr33QnoVLq3ymWAkOpk F+s/A+n9409PJLNROHcobxUcZgK0SS+vcgb9W1XQuyPUzPNXqvwocQgBkuQoMsM/ptWM 7LRuFSpNZwtSf1CgUxUk+jvs1Xyp7JWvK8t54zzFwv9MBOp3DtORlFyJmffxnk56HqHx +Bc10wlh2Z3ks6ON3yW3ZYFfzaIthGLy/d1Mw0k/PsvXzEzqtrVtAOqx6hVBZge/T2L7 kxLRnc+3MQTHo8gMdb1tYQjKUyQodzmSiasDXySEooYydU/etCvddZJctKLvmjQEKNVU d9Hg== X-Gm-Message-State: AAQBX9dhRWX5tcfB4t5UpqdwebYmb42MnspyNhAcJoBZ5VjWCHemkRoH q88nAKc/YBoccSRZp8aioLw= X-Google-Smtp-Source: AKy350ZZ7P5UBF+vHwotP5YMus5ZEOwsogu2U2z2F5htGhA4RptCv94Kife8RtOMN1PwuXjt/9y0Jw== X-Received: by 2002:adf:f512:0:b0:2d9:5608:ee0 with SMTP id q18-20020adff512000000b002d956080ee0mr1878878wro.69.1681218888245; Tue, 11 Apr 2023 06:14:48 -0700 (PDT) Received: from [127.0.0.1] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.gmail.com with ESMTPSA id z18-20020adfec92000000b002efbb93c461sm8818466wrn.25.2023.04.11.06.14.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 06:14:47 -0700 (PDT) Date: Tue, 11 Apr 2023 14:14:45 +0100 To: Dan Ackroyd CC: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: <6FA5AA43-9738-4400-8D83-38FC2D464B82@gmail.com> Message-ID: <4F87785A-038C-41BF-ADE8-F4B203E1B6E8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_=5BRFC=5D_New_core_autoloading_mec?= =?US-ASCII?Q?hanism_with_support_for_function_autoloading?= From: rowan.collins@gmail.com (Rowan Tommins) On 11 April 2023 13:01:08 BST, Dan Ackroyd wrote= : >On Tue, 11 Apr 2023 at 09:48, Rowan Tommins = wrote: >> >> Similarly, I think it should be possible to "unpin" a function >> lookup with a later definition, > >Can you say what the technical justification for that is? Perhaps "should" is too strong, but I would find it surprising if *using* = a global function made it impossible to *define* a namespaced one=2E As I said in my previous message, there is a fundamental difference betwee= n caching of unprefixed name lookups, and actual function definitions=2E Th= e current fallback and caching can always be skipped by using a fully quali= fied name=2E If additional caching is achieved using a dummy entry in the function tabl= e, a real entry for that function should be able to evict it, so that a ful= ly-qualified function name can still be used=2E >Lots of things are possible, but I'd strongly prefer to have that be a >separate discussion, which it's listed as a future scope: >https://wiki=2Ephp=2Enet/rfc/core-autoloading#higher_performance_through_= maps > >If nothing else, it's going to take people time to figure out how they >are going to organise code that is 'just' a bunch of functions=2E I'm not talking about full mapping from name to file, or about functions s= pecifically, but about a lot of existing autoloaders beginning with boilerp= late like "if ( ! str_starts_with('Acme\\Foo\\') ) { return; }", and then w= hatever logic is used for loading Acme\Foo classes=2E If the core implement= ation can perform that check, it can skip the context switch to userland co= de=2E That's a benefit to the class autoloading anyway, but I'd be very surprise= d if function autoloaders looked any different, because that separation of = ownership is pretty much what namespaces are *for*=2E Regards, --=20 Rowan Tommins [IMSoP]