Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129150 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 lists.php.net (Postfix) with ESMTPS id 798401A00BC for ; Sat, 8 Nov 2025 16:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762620636; bh=Un52c9EyribDVkCW/haLvAXO9kN+FVfg3V+DQ6cgL7U=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Qlfs7GhoqJfQehqz74ei3FL9oTUw8OeZhvZlDkNW6Mo3bwIEV38yHADl+vW+eOw+7 FMz+oZkU51hg1faBufmCApexvw2PdXVUXVbCwLRN6kKM4kggo3fBs06aDiXkhRjfy9 a97qsAL3CdpJaY7rw/OmombIHTOaRrqM8kNh++JhG+CW3721Ie0XZQUwmEMdTuDhRh Xpjmuh15IvsAQQLoxqgMlpg3ks4o1GOCLm6VZ26w6WUcwLrNlTtQdcjWjTfAdk0Sv+ 5re5Y0kC4wPJOXvPDq5iAv2NQvFOshMfSabeI/CV3uPTriJW9FiAado6AUKyHGOpu5 2q4qRKRLBhU1A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 322E5180077 for ; Sat, 8 Nov 2025 16:50:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) (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 ; Sat, 8 Nov 2025 16:50:34 +0000 (UTC) Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 33C817A0047 for ; Sat, 8 Nov 2025 11:50:29 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Sat, 08 Nov 2025 11:50:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1762620629; x=1762707029; bh=u4Ut/JT1MgcA8QKedQw01MUsdekC0Lay4JZs46XCok0=; b= cc0twpbf5+OxUhBwkiGcVowfvgFEmbqf0d9/pGVdDq5D+EHHqASM4KwWD7BmHflP iFFQ3TBwlxy1m6wZaSb44EsY5bbSinzrafsxkLQ9BIPsiCG7aDAUG13G7gj6fzgY 9ZBDs1jJJ2Fjdwz25Pz+xp8PPxEb1O4I38A8iaE50rlooRKNd2ksWKfRDtvHw8jI F2gK2Tz3289T5beOabK7HsqZHxVDwGV6PgwMFiU07h2TgaV680+xQPM6Q2tlI4nL w1mdNUkhyFPlTWX4Sv8CtnCibq51fnY+z75/79nCUtS67JwdDZ4ermahorVehM9z 8czkqIO5RsR0zkUr9DcGOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1762620629; x=1762707029; bh=u 4Ut/JT1MgcA8QKedQw01MUsdekC0Lay4JZs46XCok0=; b=Eru+O68pTVNJ8BqCP 9/Y5Oia/LOK/pMcWQUqIWGXTE1aIuCMYG8YKv86cId2ZnECAybgHiz1EegaYMmlN 6PQ7S+HeWV7Sx6kkNhnUBjHMctyMS59MTCjwCU5fchnMw4URN++3CuZxlGNxrc0n 7zXpXDe0QVha92L8Fex5TrGypr006AOAo3PwzcqZ7Y9Qty7sbRa15U6udMNwWgWy aUzVA9RYbMdX00Jv7wJIwzQAjgMkcVuD3BXkdhFh9LlQzov/QjbHGnoB3ENgE8zn qoADbuOU6dp+dz4Mobq722YkNcclUMfZlnptgxzHK2l2wA/1SU4M2Q08va9NIICC KU0iA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduleeftdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertd dtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeeltd etjeetvdehteffgefgleeviefgveehjeelleehgeegteekheejteeiheeuhfenucffohhm rghinhepphhhphdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghp thhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsh eslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 8 Nov 2025 11:50:28 -0500 (EST) Message-ID: Date: Sat, 8 Nov 2025 16:50:26 +0000 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] RFC: Namespace-Scoped Visibility for Methods and Properties Content-Language: en-GB To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 08/11/2025 12:43, Rob Landers wrote: > I’d like to introduce an RFC for discussion: > https://wiki.php.net/rfc/namespace_visibility which proposes a new > visibility modifier: private(namespace). Hi Rob, Thanks for putting together the RFC. My main concern with this and similar single-keyword proposals is that its only useful if people lay out their code in a particular way, rather than fitting with the variety of namespace hierarchies seen in the wild. For instance, in your example, you have two classes: - App\Auth\SessionManager - App\Auth\SessionStore But if this was library with a set of interchangeable session stores, it might well lay them out like this: - Acme\AuthLib\Session\Manager - Acme\AuthLib\Session\Store\SessionStoreInterface - Acme\AuthLib\Session\Store\DatabaseSessionStore - Acme\AuthLib\Session\Store\FileSystemSessionStore - etc In that case, "current namespace plus children" would work, and I'd be interested in your reasoning for requiring an exact match instead. But even that might not be enough, if for some reason it looked like this: - Acme\AuthLib\Services\SessionManager - Acme\AuthLib\Implementations\SessionStore\SessionStoreInterface - Acme\AuthLib\Implementations\SessionStore\DatabaseSessionStore - Acme\AuthLib\Implementations\SessionStore\FileSystemSessionStore - etc Here, what we want is visibilty for everything inside "Acme\AuthLib", not only in "Acme\AuthLib\Services". Since, as you say in another reply, we don't have a standard definition of "module", "package", or "assembly", I think we need a keyword or attribute which takes as a parameter either the namespace prefix, or the number of levels to match. -- Rowan Tommins [IMSoP]