Hi Rob

On Sat, Nov 8, 2025, 14:46 Rob Landers <[email protected]> wrote:

> Hello Internals,
>
> I’d like to introduce an RFC for discussion:
> https://wiki.php.net/rfc/namespace_visibility which proposes a new
> visibility modifier: private(namespace).
>
> This idea has appeared several times in previous threads but never
> progressed to a formal proposal (from what I could find). My hope is that
> with defined semantics, examples, and implementation details, we can
> evaluate it properly and see whether there’s support for moving forward.
> Feedback is very welcome.
>
>
Nice work on this.


I have one issue:
> *Visibility hierarchy: *public < protected < private(namespace) < private

I think is not a correct view of the real problem space, as the protected
and private namespace scopes are separate sets that might have things in
common but can also be distinct.

I think the correct way to model it, is to have two hierarchies:
public < protected < private
public < private(namespace) < private

Otherwise you can have things like
`protected private(namespace)(set)`
that is unclear how it should be handled.
Can you clarify what is the right-now expected get and set allowance for
these cases:
- child classes in the same namespace
- child classes in another namespace
- non-child classes in the same namespace


My suggestion is to not allow mixing protected and private namespace for
aviz.

-- 
Alex

Reply via email to