Attached is a patch implementing my proposal.
Basically, when inside a namespace, you must reference global classes
using ::globalName or by having a "use ::globalName" statement. This
allows classes inside namespaces to have the same name as internal ones
without the need of explicitly "use"-
Dmitry,
As I mentioned, I did not find any significant performance penalty with
this patch. Also, the patch can be improved by not checking the
__get_namespace_classes function if we are not currently inside a namespace.
Either way, if we ignore namespace imports, then the best solution would
Hi Jessie,
The namespace may include several files and it may be extended with
additional files in any moment. So having single
__get_namespace_classes() function will require to update it every time
you extend namespace.
Also such function will significantly slowdown access to internal
cla