Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125134 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 AE0BD1A00D2 for ; Fri, 23 Aug 2024 12:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724417257; bh=eDoK9bJ2+CIqk33HsvzbcoDcLHHdgTuVZs7nraOyniM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=dqAxFF0PamRFNObbnZo3FtSUa/NMBAigzJPDL+HvFj5wLe4nsLj+FuNQquzhevcZo HmNkI8lCZPFg4NSxWiFjPTbWy65UFZ+rdEJnXiwFacOJyDrodHDj1kTTZPAPVzkyq7 CjoHKT+Z3J1Y1j6cidK1dVPnWiUAJODi6+LDBNdq980U9QbyoYkM9iyDIxvpfD42Xa QfZ+QYf/iL/zb68lCicZNO8IpfTAyW3OnUWyHLepbPhT9vYd1BsXE38R5NriqQS42x Eupad4NDBJpADG9UeJVlL60yHcco0tejHVnHDrZ6UYBfNOJ3l1MkHkk5sBS8jj+SYI 3B0hrSf8SkXrA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 340E4180341 for ; Fri, 23 Aug 2024 12:47:35 +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,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (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 ; Fri, 23 Aug 2024 12:47:32 +0000 (UTC) Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-e164caa76e4so1758653276.1 for ; Fri, 23 Aug 2024 05:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1724417141; x=1725021941; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lHTlMG0T+sk5uBn7mRZ+cblSAwG7ddFerutt7UIXsPc=; b=jd73hS1V6LhDaCcyEujpzQI1CKMmvuVtOdI+svIb7C7otfbBs+2oGoTwAVobqwjLs0 WKGnh5J4ouy7j+9lB8h6KWgw87ktL281lILIHvAoaitFsWV0UEJwQVAWhIZfW1pp1ASC pHQKT47pFU3WQdF9B5Cz3ibnW3WRY29BMbLW/CkCE3WEwq3bjRuv2xc3+L5yGOaRAFEk EN8FOLOzPiz/72jaC+mR0I8bDSYydUbFkPqao1CIYWKgeKYo3hEc/Syt6SKwelVIherm 9pKpVmd6zNurGM02Q7shmorxqXcdn5l5Z435GxG2DPOYC9sfP4MOr7mqLDreLw4o3l4e EZOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724417141; x=1725021941; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lHTlMG0T+sk5uBn7mRZ+cblSAwG7ddFerutt7UIXsPc=; b=PSN2Vr3kmbQyJkM+VERavaJZvTc7qMr6/SHqKK63lJnnBu/TjVwOzInQWZDsHsJPj1 SET9KTAgQqj5rxOoIpqbBVYU0/Nwd+2KwEX5Ag1+cR7EdDSyK8jDpZ4T7wYwHKvLJuzV xC3g0p53UESCMWoWh+kwo1q3bTiBuWoO+BVFu/bRxwbzDDqbHDHWmVP68OliDUZ9q6j9 A0xhGWcPsije73Od+OT/YoTERmYNw69rXoIBLwVNZHf6/T4BKXUM4dKocaSSnR1Zb0Nq YJwe/2fWpyEBHbhw4O2TxPEs1mAFpsdTEsK9Hxqe4Tt0oXqIi1Nm+jQPbDcv156m4o6N IN+w== X-Gm-Message-State: AOJu0YxrJSS29vB9m+2j5I5B2W6tj1wOCHoQBznDhCnidZXKWKWMfvON O7+kEgHDCAb0XJF/xbAKiTdFacIsho9PW/IvZ6QzD68Kr7Owi8Edgzn+NwadYoySLfHQjjuJ95y 2hRE= X-Google-Smtp-Source: AGHT+IGNyuvS4vZskKicfHR1VKLbQGBX6pDJBAyZ5DYxwaOQ+bjTqUYzPrBViD9oyHBIh0+BzhRRnQ== X-Received: by 2002:a05:690c:f01:b0:6af:a6aa:2b3a with SMTP id 00721157ae682-6c6248e8c77mr23589067b3.1.1724417140889; Fri, 23 Aug 2024 05:45:40 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6c39de3e1c5sm5323277b3.118.2024.08.23.05.45.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Aug 2024 05:45:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local) In-Reply-To: <5BE5A0A9-BCB5-4E2B-8F11-1EDF49884BE1@rwec.co.uk> Date: Fri, 23 Aug 2024 08:45:38 -0400 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <02F24EA6-9407-4E3E-937B-F4FE3393DFC6@newclarity.net> References: <846D7756-712B-4A7C-9FC6-DB9F858836B8@rwec.co.uk> <838adce3-12da-49f3-88f2-883d63e93e89@app.fastmail.com> <86C995C8-AFF0-4E4B-8385-69BC701B887E@newclarity.net> <5BE5A0A9-BCB5-4E2B-8F11-1EDF49884BE1@rwec.co.uk> To: "Rowan Tommins [IMSoP]" X-Mailer: Apple Mail (2.3696.120.41.1.8) From: mike@newclarity.net (Mike Schinkel) > On Aug 23, 2024, at 8:33 AM, Rowan Tommins [IMSoP] = wrote: > On 23 August 2024 13:04:22 BST, Mike Schinkel = wrote: >> And how can it occur without an explicit `use = AcmeComponents\SplineReticulator\Utilities\Text\Text` statement, which I = proposed would override the automatic `use`, anyway? >=20 > I'm not sure what you mean. Right now, that's the function name that = would be looked up for your example code (other than a couple of = unrelated typos in your example). So if, for some reason, someone was = relying on that, their code would break with your "automatic use". I must be missing something. Can you give a specific example showing = how the automatic use would conflict with something other than a root = namespace? >> The only one of those that has a strong analog to existing PHP code = is to "use the end of the current namespace" as people frequently do = with explicit `use` statements. >=20 > True. I just don't love the context-sensitive nature of it. Well, we frequently see things differently, which is what it is.=20 Myself, I like the explicit nature of it that allows seeing at a glance = that it is Text without having to look up through a long PHP file to = find the namespace statement. But as my dad says, to each his own, I = guess. Besides, I think there may be some better solutions discussed on this = thread besides our dueling qualification syntax. >> Lastly, no comment on `\\`? >=20 > Ah, yes, I forgot to say: I'm not keen on that because in other = contexts it means exactly the opposite: it refers to the absolute root = in a context where a relative name would be assumed. >=20 > For example, \\domain\username and \\server\fileshare on Windows, or = //example.com/foo in a URL Fair point. But then treating built-ins differently than userland = globals may be the way to go that has the least BC breakage over either = of our two proposals here. =20 That said, having an automatic `use` would be nice for those who want to = use it, even if it is not required. -Mike=