Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125141 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 D7CFD1A00F7 for ; Fri, 23 Aug 2024 13:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724419830; bh=C4fFtvMSRbQporrCpaS/MGpDgxZ7uUuk96TPawqxsoI=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=RACDcIbT+5FRmB/vjgMG3DMFgb2gv4RovJo98QoVrJsRJpq0L7t36rUL5WOCKjd2V Wb2hL1oTp8QmFZOXna+Z/L7T/1E9FXbpkBrht+sJYh2e8L5wb64mv6IEvj6/5pSAYk 2LewjbRbLl+miQjXotXImUJ6hS4adEPZk7Z2n5C/erL3Ngsis2UW71CE+p+kaj35kA 1c54moCBhPMaKyXyw3tYtwyQtAyQ+SuMWacVEq7i9VU2ERXRTgfgCbZzGRzaWJF/5a zYEIULUOIf5qp575Ze0OQ5HhX36FW07lvE11c09/WxtEOgL8UAOymaHTQR5EZmDUyL w1VZrVOs5xcqA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F07EF180390 for ; Fri, 23 Aug 2024 13:30:27 +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-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 13:30:25 +0000 (UTC) Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-e115c8aa51fso1984405276.1 for ; Fri, 23 Aug 2024 06:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1724419714; x=1725024514; 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=gMVWjY+1e1sVVg5OEQN3rNRGNqVRGXzNBHPuaTDODe0=; b=JBoa2y/U6oipLLIB2BrXOBOlsdgbv7S6V7aLK9seOOKYrugUEQF+7fqzD0YiOMg4nz r+gV/AU+dHsDdhPmh0JRihRT8uuNg8wsSVsfKfWQKH2LlC0FWCqP4GJWhYJvzigUz/DB Dx3FBYjMajp8hzmfQ2iVcI3i7LKjd0W7jAuH1KCe86Tb9sislZVuqdVl8BShSIayPCB4 nyoaNkmr85VIgTWF6sVkBSMFwuFycMl/gweatpRgc6Lzai40cM4okhbTW27ptAM9mvs5 965LF7yAHnAC+sea2N1atm7oxfdFl8ntkXS8Okx6b/vZW0eAFgLho+r6WHvnbYslDvSD OaqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724419714; x=1725024514; 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=gMVWjY+1e1sVVg5OEQN3rNRGNqVRGXzNBHPuaTDODe0=; b=ImxgWh82+OoXKUvXfFKlG06Zq8kGNRdWicwW7NTIeJCtqpaXcoX9NkFG/37oJF7owr thYnkHBaz6zTv8V1ZTaRSoQxlbR31DN9xjBoORSrS0le6g8jwzqXEbsxbaaJfQOZkmyO Eq2hkZk+qOLS5ueAVykboU53JZiUgKEMHZCqyxnW9X0n4WrPl5bcCsqKY17hpMPJPs2A 5yC1DnRoOofwlMxfhxZSjl0JdFs5zQ71JvtgL/Y7FNa/O7KRivHvCgMpdf9k8zQtCyuY J8kPOV+3wNUIS1jJYf8hFkwLk+UcaxBw7VUNay6cM3BlvcqOYslNhwtxS2uMPNJthmzy tnHw== X-Gm-Message-State: AOJu0Yxn35ZMxTDBXOz7XDc7hMY7fmLjwV6WRaYeJugpE0pOgnVMR5fZ gjsVmrzChBEvj9psBA41G2H3EanJaa41Uk+ZchSwh49ZgQl2QP2+AQKVW3pZT2gkDGl9oT8ABXD hc1I= X-Google-Smtp-Source: AGHT+IF1wB2X2bq0XojHqfKy3UkhxI9AWdB+ov//5SHZr8n7vSuoFNny35t67+2XTabJMasNQSIPrQ== X-Received: by 2002:a05:6902:1681:b0:e03:61d4:ab35 with SMTP id 3f1490d57ef6-e17a866d9aamr2898062276.53.1724419714163; Fri, 23 Aug 2024 06:28:34 -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 3f1490d57ef6-e178e4637cbsm647367276.22.2024.08.23.06.28.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Aug 2024 06:28:33 -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: Date: Fri, 23 Aug 2024 09:28:33 -0400 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: 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> <02F24EA6-9407-4E3E-937B-F4FE3393DFC6@newclarity.net> 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 9:07 AM, Rowan Tommins [IMSoP] = wrote: >=20 > On Fri, 23 Aug 2024, at 13:45, Mike Schinkel wrote: >>> 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". >>=20 >> I must be missing something. Can you give a specific example showing=20= >> how the automatic use would conflict with something other than a root=20= >> namespace? >=20 > You already gave the example yourself, you just misunderstood what its = current behaviour is. Here it is, with the typos fixed: = https://3v4l.org/6eD3N >=20 > As you can see from the error message, it doesn't look up = "Text\strlen()", it looks up = "AcmeComponents\SplineReticulator\Utilities\Text\Text\strlen()" >=20 > Or to be even clearer: https://3v4l.org/ojVcP Thank you for clarifying.=20 You got me there.=20 And it is a good illustration why I continue to really dislike how = namespaces work. Too many footguns that are too easy to misunderstand. =20= But it is what it is, I guess.=20 -Mike=