PHP has its magical methods `__call` and `__callStatic` which allow to intercept the calls to non-existing **methods**. I am looking for a way to intercept the call to non-existing **function** (the one that sits inside a namespace, not a type).

Is it possible to do (PHP7)?

*For a moment I considered putting functions inside proxy class, but namespace can span over several files, and if I am not mistaken, PHP does not have partial classes, thus this approach is of no use.*

Update: multiple files per namespace problem.

Let's say I have file A.php and B.php, both with the same namespace, say `Text`. Consider putting all the functions to proxy classes. And now I have file C.php and I have call `Text\indexOf(...)`. However I don't know if this is `Text\proxyA::indexOf` or `Text\proxyB::indexOf` because all information I have is name of the namespace -- `Text` -- and function name. So from caller side I am toasted.