Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119916 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81127 invoked from network); 11 Apr 2023 13:27:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Apr 2023 13:27:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 62AB1180041 for ; Tue, 11 Apr 2023 06:27:59 -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=0.6 required=5.0 tests=BAYES_50,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-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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:27:58 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id e2so7506978wrc.10 for ; Tue, 11 Apr 2023 06:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681219677; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hTEBjW4CFDj9suGikdNuWtl3GEyairEywpnVP6Ri2go=; b=JXck01U7TKXMpECS9+N5DbVFhqrO/ErptEeDVA9DiHfHPZo76HFPNQN+cmc9/fFPxF zLrkTD3cdDBLdhVdzd7GIcFjueTXWT9VgKqveFVd2bUgl1JRTa2Vv56lzMSyoAx5hFFu gNeQ4We2DT/KVs+nYVmAXMUDMDsH3SPoO0CD+SQwfy+7oWzEEkf2Vl8Hpw8sFoMqLS2b aUE6Yl80KRVJYGZ0N8AXBomcl6UO/YmNtI87tD1WbVMb2GS6ZKikzDx34YcFcratbosq H3ejfdT6Z6AGJnUxAnAjAiJ6rXARZoPcE7LfhPzx3Czjw8OGWWLnmLpH/0hX9LIHEEaz 54Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681219677; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hTEBjW4CFDj9suGikdNuWtl3GEyairEywpnVP6Ri2go=; b=pkdKm+CEbAI+aHUucRGeSR/7T7VdSZtmWA80j57w+2Yd79mKZLR1/yA7HrlAwcQnH7 AeJwJ8N6lv5rxs75FB+KAl0xOGQJoCVcbZ61eKTLYoSxptRkh/FkZ99giqyZ5xYEPQzJ lombe9BTlF2ICMDwsst/Jqd0F5EdJgOwzClkFbOP1E1aQ6QoyMAGENC73sZY9/3x2fIX C7z2ouFJlMtpTvaEuKQGSMSSHsLQiPmT/c9XTzvyoP/fWHv3+aUsFL5VErVZnsiAqD5T gSDwxLp91ncJUWZUpIGjyrA9L60FPAXTQxkOuVWwBgyP+c5qjjwrTLGGNkfG9i9GfNiR IENQ== X-Gm-Message-State: AAQBX9fQyApkOCGDsMyPglNP+IaX4hUDwJmgzBdAb4jQKe/UCeQDx7EO hyZKNoRAEMWwNMfON73BCYj6t9x/69E= X-Google-Smtp-Source: AKy350ZjTRL1DhcMPH955g4LQoFKxBpXNdS8a0OfciuTSccVaNTMSzYJ5fZb92UEgJ0SM5uGC3eUpA== X-Received: by 2002:a5d:488b:0:b0:2cf:3a99:9c1e with SMTP id g11-20020a5d488b000000b002cf3a999c1emr8531349wrq.49.1681219677571; Tue, 11 Apr 2023 06:27:57 -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 c5-20020a5d5285000000b002cea8e3bd54sm14604477wrv.53.2023.04.11.06.27.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 06:27:57 -0700 (PDT) Date: Tue, 11 Apr 2023 14:27:54 +0100 To: internals@lists.php.net, Mark Baker User-Agent: K-9 Mail for Android In-Reply-To: <65286b1d-3a27-06bb-191a-96250ddb83ac@demon-angel.eu> References: <65286b1d-3a27-06bb-191a-96250ddb83ac@demon-angel.eu> Message-ID: 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:21:08 BST, Mark Baker wrote: >We have the special constants like \MyNamespace\MyClass::class=2E Would y= ou envisage (or is there value in) equivalent constants like \MyNamespace\M= yFunction::function? This has come up before, but there are two things about ::class to bear in= mind: 1) It has nothing to do with classes=2E It just means "resolve namespaced = name", and doesn't care what string appears on its left-hand side=2E 2) It is calculated (except in a few specific cases) at compile-time, base= d entirely on the contents of the current file, with no relationship to aut= oloading or what is defined elsewhere=2E That's very different from function (and constant) lookups, which happen a= t run-time, and specifically check whether a function is defined in the cur= rent namespace before falling back to the global one=2E In other words, the= value of foo::function would be dependent on runtime state in a way that F= oo::class is not=2E Meanwhile, the main use case for such a syntax - getting a reference to us= e as a callback - is now well served by the first class callable syntax my_= function(=2E=2E=2E) Regards, --=20 Rowan Tommins [IMSoP]