Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129149 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 A7EB51A00BC for ; Sat, 8 Nov 2025 14:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762613029; bh=h7sE0dPsoXfJ2LIt5RcXmWr3s3jadca9Xj1/+l1bkLA=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=gif5xo3POinCEjNitvXvwz7PhKRTx9I/Mm7wdTMLNbA2wls7rJIGZiEJEeLrLGCwj 2S4O7WbfjemLCotSZL/SEbOScinKbf9XCWlxhFYm0HhphASN+beGIva9n9Y2h6ngmr DhRGzebKsb2JXZN5xlNcXjJGqDvhIdPtZ7foajmZAWKB52hOLKLSHLEn7nC87isLD9 DxGQAVhuWQRV25JEwlup3VThbm1UHTff98/xnx1oZvolhDYlQ+/k4hC7Z5jNdHKJo/ jaTiH7nmnPKREux/czCgMqs0etU7e3eBOSUMOHnwIRmlq48dzzWGS2vxxWqXIjnI2C 2+z6m4gIFeBcQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A1EB180041 for ; Sat, 8 Nov 2025 14:43:48 +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=-0.1 required=5.0 tests=BAYES_50,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-b6-smtp.messagingengine.com (fhigh-b6-smtp.messagingengine.com [202.12.124.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 ; Sat, 8 Nov 2025 14:43:47 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8D6C87A0090; Sat, 8 Nov 2025 09:43:42 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-12.internal (MEProxy); Sat, 08 Nov 2025 09:43:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc: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=fm1; t=1762613022; x= 1762699422; bh=h7sE0dPsoXfJ2LIt5RcXmWr3s3jadca9Xj1/+l1bkLA=; b=R p8Kdx7+JHnZAVQVcoeeQqPuFPU10DVyhUWt9pFsPwzah6VLGy4joqRoz1wJtrYij 7IM43epSp32MsDZpY66voWIdzL/VYvyO/1RS4a2uWTUDFzDCjFNb494nKPH9QzX5 ufmh6F1CBinmZDGmhyl2t+CjH1R8x63VcDVmvSBMg5uQdi8hCJGYPzC51ElckB5W 4LLWmyuwQQIvuir+pgn4PdoPck7760JVWC0KHg0J9edOTXJMVfinCKiPZgSIFSgP Pz7ZKqayKqRt7uo6O0iiUBchYWZNpGbhm8AnumZt5niCnF0HehoBfMGIW6+E419o biNI70mbRuJvNThamrxVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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= 1762613022; x=1762699422; bh=h7sE0dPsoXfJ2LIt5RcXmWr3s3jadca9Xj1 /+l1bkLA=; b=bg8EbY88pSQ1UjUFjme6QE+LGwo0dGw4KUYvIQ/fE+6um0arghM eJQHeQjzlcaMtcbYWO1igL7ImrPwLV3oyUVPdnxPZA4R8VUi07ChOYUwN0s01UJ4 icqq2vYV6j9II3qkyhHqWnxJSA6TjolpRG1DyknNyaIV982Fm9hln86DxFJ4hUuB 0qzGu8pbZBHkIVnDOrFRZBatV8kG306MnmnUZ/hNYzRs3bQoDD6sX+sNOYWmh6wO 7kxwa2THiiQAzRFuC1o8KjhXuoobiHc66Gp9k9FHQpipLzHYcdTim9GwM2jAzxkH +job6fDrBUXYhCsOuvWdBuC9zRRwIaY2nOg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduledvkeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgesrgdtreerredtjeenucfhrhhomhepfdftohgsucfn rghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrghtth gvrhhnpeffgeevveegtdffgfffvdfftddvheeuleegveekteffueeliedtgeekjeettdet keenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehrohgssegsohhtthhlvggurdgtohguvghspdhnsggp rhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehtvghkihgvlh grvdegieesghhmrghilhdrtghomhdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhs thhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id B86391820054; Sat, 8 Nov 2025 09:43:41 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AZgO4gJIj6HZ Date: Sat, 08 Nov 2025 15:43:21 +0100 To: "Kamil Tekiela" Cc: internals@lists.php.net Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] RFC: Namespace-Scoped Visibility for Methods and Properties Content-Type: multipart/alternative; boundary=054858131bea4701905c7b184b8d66ed From: rob@bottled.codes ("Rob Landers") --054858131bea4701905c7b184b8d66ed Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Nov 8, 2025, at 14:30, Kamil Tekiela wrote: > On Sat, 8 Nov 2025 at 12:44, Rob Landers wrote: > > > > Hello Internals, > > > > I=E2=80=99d like to introduce an RFC for discussion: https://wiki.ph= p.net/rfc/namespace_visibility which proposes a new visibility modifier:= private(namespace). > > > > This idea has appeared several times in previous threads but never p= rogressed to a formal proposal (from what I could find). My hope is that= with defined semantics, examples, and implementation details, we can ev= aluate it properly and see whether there=E2=80=99s support for moving fo= rward. Feedback is very welcome. > > > > Sincerely, > > > > Rob Landers >=20 > I like the idea except for the name. Why not use the internal keyword > like C# does? >=20 Hi, thanks for the feedback. The main reason I didn=E2=80=99t choose "internal" is that it implies so= me broader boundary than PHP currently defines. In languages like C#/Kot= lin/Swift, "internal" is tied to a module or assembly, not a namespace. = PHP doesn=E2=80=99t have a formal module/package boundary today, and I r= eally prefer not to turn this RFC into a discussion about defining one. private(namespace) describes exactly what it does: it widens private to = code in the same namespace and nothing beyond that. It doesn=E2=80=99t i= mply any other boundary or hierarchy. It=E2=80=99s also consistent with = asymmetric visibility (public(set)/private(set)/etc), without introducin= g a new keyword. If we ever introduce modules or packages in the future, internal could c= ertainly be layered on top, or become syntactic sugar over private(names= pace) =E2=80=94 or some part of it. Much like readonly is now almost syn= tactic sugar over "public private(set)", other than the write-once restr= iction. For now, I=E2=80=99m aiming to focus on making internal APIs easier to e= xpress without inventing a new packaging system. =E2=80=94 Rob --054858131bea4701905c7b184b8d66ed Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Sat, Nov 8, 2025, at 14:30, Kamil Tekiela wrote:
On Sat, 8 Nov 202= 5 at 12:44, Rob Landers <rob@bot= tled.codes> wrote:
>
> Hello Internals,=
>
> I=E2=80=99d like to introduce an RFC for = discussion: https://wiki.php.net/rfc/namespace_visibility which proposes a ne= w visibility modifier: private(namespace).
>
>= This idea has appeared several times in previous threads but never prog= ressed to a formal proposal (from what I could find). My hope is that wi= th defined semantics, examples, and implementation details, we can evalu= ate it properly and see whether there=E2=80=99s support for moving forwa= rd. Feedback is very welcome.
>
> Sincerely,
>
> Rob Landers

I like= the idea except for the name. Why not use the internal keyword
like C# does?


Hi,= thanks for the feedback.

The main reason I did= n=E2=80=99t choose "internal" is that it implies some broader boundary t= han PHP currently defines. In languages like C#/Kotlin/Swift, "internal"= is tied to a module or assembly, not a namespace. PHP doesn=E2=80=99t h= ave a formal module/package boundary today, and I really prefer not to t= urn this RFC into a discussion about defining one.

<= div>private(namespace) describes exactly what it does: it widens private= to code in the same namespace and nothing beyond that. It doesn=E2=80=99= t imply any other boundary or hierarchy. It=E2=80=99s also consistent wi= th asymmetric visibility (public(set)/private(set)/etc), without introdu= cing a new keyword.

If we ever introduce module= s or packages in the future, internal could certainly be layered on top,= or become syntactic sugar over private(namespace) =E2=80=94 or some par= t of it. Much like readonly is now almost syntactic sugar over "public p= rivate(set)", other than the write-once restriction.

For now, I=E2=80=99m aiming to focus on making internal APIs easie= r to express without inventing a new packaging system.

=E2=80=94 Rob
--054858131bea4701905c7b184b8d66ed--