I don't believe that there is no, but I can't verify for 100% certainty since I use namespaces exclusively with objects and constants (and actually, I can't recall the last time I made just a function tbh). A big part of the purpose of namespaces being used is to prevent the potential collisions that occur by segmenting each "part" into its own little sandbox; it also allows the closest thing we'll get to overloading in PHP (ie: I can do:
PHP Code:
namespace MyNamespace
{
function strlen($s)
{
return strlen($s) * 2; // note there is a backslash here; the forums strip them out. Quote it to see.
}
}
), so it will create ambiguity if I don't specify which function's I'm looking for. It will always fallback on a global though, so if I try strlen() within namespace MyNamespace2, then it will attempt to load MyNamespace2\strlen and if it cannot find it will revert to \strlen. So even global classes for example require importing into a custom namespace; global fallback only works on functions and constants.
You can of course use an auto_prepend_file directive in order to automatically load a specific script prior to any other processing. Perhaps this could be of use in organizing a global script which imports the necessary namespace functions via aliasing (I think you can import function's as alias)? Ultimately it will come down to if you can do
use MyNamespace\functionName AS thatFunction;, for which I'm afraid I just don't know offhand and the documentation doesn't appear to specify this for functions. Maybe you could get away with the prepended file and a closure approach, I'll give these couple a try when I get home.
Another question could be, why? Since you are referring to vendor here, that would indicate to me that code blocks are created by many third party. With this assumption, I would suppose that a common api is provided, and I'm guessing there is class use involved as well? If so, you can simply force them to extend an abstract class which allows the gateway between their functional code and your expectations. This abstract could be used to enforce a namespace import as well.