问一下大家自动装载是自动加载的意思吗,就是会调用spl_autoload_register()之类的函数。
Reply content: !--? phpnamespace a;use b\d, c\e as F;new B () ; Create an object of class ' B ' defined in namespace ' A '//If not found, try to automatically load class "a\b"
Ask everyone if automatic loading is automatic loading means that it will call SPL Functions such as _autoload_register ().
Auto Mount
here should be auto load The meaning of the
. But Spl_autoload_register
is not called at the time of New B ()
-it should have been called before. new B ()
is automatically loaded simply by invoking the autoloader registered with Spl_autoload_register
in the order in which it was previously registered.
For example, there has been a previous registration of two autoloader:
spl_autoload_register (foo ); Spl_autoload_register (bar);
Then call foo
at new B ()
after calling bar
...
For more information about Spl_autoload_register
, please refer to: http://php.net/manual/zh/function.spl-autoload-register.php