Maybe this is weird question, but I can't work it out what happens internally in php when you write:
use garcha\path\class;
I'm not asking about purpose of namespaces, but about that statement itself, even it does not allocate any memory, I mean, when you even give an alias for some class:
use garcha\path\class as withNewName;
Where is it stored? Or how does it remember the names? Does it happen just on compile time? and not run time? something like just describing the function.
namespace Test { class MyClass {} } namespace { use Test\MyClass; }
and then usephpdbg
to dump out the opcodes. You'll only get a ZEND_NOP because there is no runtime code there. – Scarron