# I would like to write an RFC for the addition of an internal keyword

- Thread: https://externals.io/message/66384
- Original archive: https://news-web.php.net/php.internals/66384
- Started by Jens Riisom Schultz on 2013-03-01T06:23:04+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #66384 — Jens Riisom Schultz — 2013-03-01T06:23:04+00:00

URL: https://externals.io/message/66384#66384

> Setting aside difficulty of implementation, I'm coming around to the idea, though I think you could simplify it by cordoning off an entire namespace. E.g.:
> 
> A namespace at least two deep (e.g. \A\B\) may be marked 'protected' (by some method TBD). Classes and functions declared in a protected namespace can only be accessed from methods or functions inside the same namespace, or in ancestor namespaces.
> 
> E.g., if \Foo\Internal\ is protected, access of its classes/functions must originate from classes/functions defined in \Foo\, \Foo\Internal\, or \Foo\Internal\*.
> 
> This would allow something like nested classes, but obviously with a lot more flexibility.
> 
> In practice, plugin code sitting in, say, \MyPlugin\ could freely access \Framework\SomeClass, but not \Framework\Internal\SomeClass.

This would solve the problem of internal classes, but these are the least interesting part, imho - The methods and properties are much more interesting, hence my new approach in response to Fabians response, where I drop the concept of internal classes. Please refer to that.

> 
> I see some value there, but there's tons of questions remaining and how to to implement the damn thing...
> 
> Steve Clay

-Jens
