I think it would be useful if namespaced functions automatically
propagated to all child namespaces as well.
An example use case of this would be packages having their own helpers
like this:
namespace MyPackage {
function foo() {}
function bar() {}
}
And being able to use them in MyPackage\Commands, MyPackage\Fields, ...
as if they were global functions.
The benefit of this is that packages could safely add helpers functions
without risking conflicts and having to do awkward function_exists()
checks (which can break things easily). And there would be no overhead
of having to import functions, since that seems to be a pretty obsolete
practice nowadays with only classes being imported in most major
projects.
Which means that this could revive the practice of namespacing functions
while solving the problem of conflicting global helpers from multiple
dependencies.
And of course, this is a breaking change. Though I'm not sure how big of
a problem upgrading would be, since having multiple functions with the
same name, but in different namespaces, seems like a pretty rare thing.
Thanks,
Samuel