Re: RFC: Namespace-Scoped Visibility for Methods and Properties

From: Date: Sun, 09 Nov 2025 18:01:50 +0000
Subject: Re: RFC: Namespace-Scoped Visibility for Methods and Properties
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-129174@lists.php.net to get a copy of this message
Hi On 11/9/25 16:07, Rob Landers wrote:
I’ve updated the RFC and implementation accordingly along with some editorial changes.
The RFC now mentions:
Combinations that mix protected and private with private(namespace)(set) are a compile-time error because their allowed caller sets aren’t subsets of each other.
Which is not particularly explicit in what “mix” means. I initially missed the (set) in the private(namespace)(set) until I read the ML discussion. From what I see the RFC does not discuss the following at all:
    class P {
        protected function x() { }
    }
    class C extends P {
        private(namespace) function x() { }
    }
and vice versa:
    class P {
        private(namespace) function x() { }
    }
    class C extends P {
        protected function x() { }
    }
Best regards Tim Düsterhus

« previous php.internals (#129174) next »