[RFC] Friends#21937
Conversation
| <?php | ||
|
|
||
| class Foo { | ||
| friend Bar; |
There was a problem hiding this comment.
Would it make sense also to allow wildcard at the end like friend *; or Subnamespace\* or \DifferentNs\*?
There was a problem hiding this comment.
friend * is just making things accessible in all classes, but not outside of classes, which doesn't seem much better than just making things public
namespaces with wildcards feels like a backdoor namespace visibility, which is something being discussed separately on https://wiki.php.net/rfc/namespace_visibility
There was a problem hiding this comment.
I meant * (not \*) to allow all classes in current namespace.
There was a problem hiding this comment.
I think that is potential future scope but should not be included here, and I also think having friend * mean everything in the namespace rather than everything in any namespace would be a bit confusing, so I'm not going to include that in the initial RFC, but thanks for the suggestion
No description provided.