On 30 May 2025 19:21:08 BST, Alwin Garside <al...@garsi.de> wrote:
>In the example above, I image calling or extending the `Foo::bar()` method 
>from somewhere outside the `Acme` namespace would trigger an E_USER_WARNING or 
>E_USER_NOTICE. The warning/notice could then be suppressed when explicitly 
>overriding an `#[\Internal]` method with `#[\Override]`.


I don't see any reason for the message to be any quieter or easier to override 
than calling a private method. 

Indeed, one use of an internal/module-private feature would be when the author 
wants to split up a class that has a large number of private methods: the new 
classes need to be able to talk to each other, so the existing "private" 
keyword is no longer appropriate, but the intended surface to users of the 
library has not changed. The user is making exactly the same decision by 
ignoring the "internal" flag as they are if they use reflection or 
code-rewriting to ignore/remove the "private" flag.

Rowan Tommins
[IMSoP]

Reply via email to