Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129199 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 364ED1A00BC for ; Tue, 11 Nov 2025 15:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762874081; bh=1mw0U3TFsweBbEIW+f/2VtCWjOGdBSAVovygs00oT9E=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ZGC56OjcCIppcUeXgyuJ9+7QLF+yjnoE5a5bX1Nceabt4M7jfWqbfyOOZj5onQENS k0/uJY4SxfjrsgGLNfdVLLF1FxrLhTRF5+todIZ6MXpfAlwhGU944jKUitlHxxGSLD Ul/QnAbsCrsRaKvG3IWcg7L5TUvZpdmejaLD09742Pbx2lM4hw49VziWLBiAZ+V+gB 1fKgDtzikovekXbCGK9JSaFeBx1uwbVNWBszamZRzrht+jHx9DqtwcC2dWJ1bdT2mz O+IxSzrGoheGxsLfDNomCwmOEtrmlKvdZ1L3PI6+oRElwBZ2hP4WRLy6wyjy1CszNh fKVhvXOYK2nVQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CD446180040 for ; Tue, 11 Nov 2025 15:14:40 +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,HTML_MESSAGE, 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-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (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 ; Tue, 11 Nov 2025 15:14:40 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id DF9681400247 for ; Tue, 11 Nov 2025 10:14:34 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 11 Nov 2025 10:14:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :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=1762874074; x=1762960474; bh=o6qLlQsoGE Z0TRIj8OKAcOT3qCcei4IAscsW/EN93kc=; b=TTOtOM+k17M3wJTq5/G6UXjYyo BP5DPGoUBcc8e9Whqu84uOZOmVAZXATYS30oIMbmcLnHP2WylUckQtL0ZTJCC4+5 awNW6f9PbU+rZpQrNCX1E+fsHyzM4pKUAZ/fU1O0MuRo4pYs+NHLw3Je5oOZZ9ni Z4DVvjWFPKyGGzDO05G638zpcLdyzXk13ftEbUDBG+KjnLy4wZS9gnefaXuzqzo9 bU3nMMBDTK4wKzJ5SNJx1nf2cQoybHLiELV8UZclkPUXQRYfbypJiFlqhhXJg1uH dGfs6O2fT8vKfEkiTiyec+VHWw2PwdLOIZ7e3P5TnKRu7cOAmiiwsSF6gBTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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= 1762874074; x=1762960474; bh=o6qLlQsoGEZ0TRIj8OKAcOT3qCcei4IAscs W/EN93kc=; b=yFQcoL+R503brjKX7r/DKT6ZzPJoqHWXQJHSKvrvYM5v8iPxfKO hoQtHqeNi88xVeKMIxGmqy0x4oBL1OYDx1cE57JpXpUbKhE0YOB/GU4QxA9YFSbA Uwnu7IdnDe/tRPs85o0z/dMm3J76sElvEaVSbbsF6wuXDH+vwZPIjW+J6EMg3QyT YKqmy17Mo44N/v83awh7FIJyxxzd7X1UW5xd5m65Zbmsf3EJ7v/q2EikXoXOiFiX 8sr0TmEyBtND/h7BxI96zeGEHWiaR3axYLD2Mt08mMs6KRCPAROzfn8sl9QnnXsG uLLqZTWtBJ/Yh+kj16HLVxP5UTRNEpKKKgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvtdduhedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertd dvjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehi mhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhepheetle eiiefgueduieeuieffvdevheduueefkeejuefgffeftdeitdegtedtleetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhph esrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 11 Nov 2025 10:14:34 -0500 (EST) Content-Type: multipart/alternative; boundary="------------0ME6zUCzY8PKXbOPHX5PI4bs" Message-ID: <6fe4d3dc-4ee5-4911-b695-a8d36f034143@rwec.co.uk> Date: Tue, 11 Nov 2025 15:14:33 +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 To: internals@lists.php.net References: <72f90052-fa19-415c-9f5a-ae75275fd030@rwec.co.uk> Content-Language: en-GB In-Reply-To: From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") This is a multi-part message in MIME format. --------------0ME6zUCzY8PKXbOPHX5PI4bs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/11/2025 11:36, Derick Rethans wrote: > On Sat, 8 Nov 2025, Rowan Tommins [IMSoP] wrote: > >> To spell those out, the prefix version could look like this: >> >> namespace Acme\AuthLib\Somewhere\Deep\In\Package; >> // ... >> #[NamespacePrivate('Acme\AuthLib', includeChildren: true)] > Whatever the way to define a prefix is going to be, I disagree with that > being done through attributes. > > Nowhere in the language do these annotations (yet) interfere with > how code can be run. The main reason my mind went in that direction is that people are building attributes for this in userspace already - set the actual visibility to public, and then use an attribute for static analysis to restrict it. They also have a standard syntax for arguments, so it's easy to illustrate those without spending time imagining a new syntax. But in general, I agree, a native implementation would ideally look and feel like it matched the existing "private" keyword. -- Rowan Tommins [IMSoP] --------------0ME6zUCzY8PKXbOPHX5PI4bs Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 11/11/2025 11:36, Derick Rethans wrote:
On Sat, 8 Nov 2025, Rowan Tommins [IMSoP] wrote:

To spell those out, the prefix version could look like this:

namespace Acme\AuthLib\Somewhere\Deep\In\Package;
// ...
#[NamespacePrivate('Acme\AuthLib', includeChildren: true)]
Whatever the way to define a prefix is going to be, I disagree with that 
being done through attributes.

Nowhere in the language do these annotations (yet) interfere with 
how code can be run.


The main reason my mind went in that direction is that people are building attributes for this in userspace already - set the actual visibility to public, and then use an attribute for static analysis to restrict it.

They also have a standard syntax for arguments, so it's easy to illustrate those without spending time imagining a new syntax.

But in general, I agree, a native implementation would ideally look and feel like it matched the existing "private" keyword.


-- 
Rowan Tommins
[IMSoP]
--------------0ME6zUCzY8PKXbOPHX5PI4bs--