Re: Alternatives for encapsulation when using composition instead of inheritance
| From: | Olle Härstedt | Date: | Thu, 26 Aug 2021 14:35:54 +0000 |
| Subject: | Re: Alternatives for encapsulation when using composition instead of inheritance | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115857@lists.php.net to get a copy of this message | ||
2021-08-26 16:20 GMT+02:00, Christoph M. Becker <cmbecker69@gmx.de>:
> On 26.08.2021 at 15:47, Olle Härstedt wrote:
>
>> * Friend classes, like in C++: Class B is annotated to be a friend of
>> A, so class A can see the content of class B but no other class can.
>
> <https://wiki.php.net/rfc/friend-classes> has been
> declined.
>
>> * Namespace private: Class A and B are defined in the same namespace,
>> so they can see each other's properties that are defined as "internal"
>
> <https://wiki.php.net/rfc/namespace-visibility> appears
> to be inactive.
>
> --
> Christoph M. Becker
>
Thanks! I'll check the belonging discussions on externals.io
Olle