namespace \Common\Tool ; (Note there is a backslash at the beginning!!!!)
Common\Tool and \Common\Tool are the same. Why can't we add a backslash at the beginning when declaring the namespace?
The reason for the error is undefined constant CommonTool (undefined constant CommonTool). Why does the system determine this? Isn't it a rule that you can't add a backslash at the beginning? Looking forward to the answer, thank you all
大家讲道理2017-06-06 09:55:43
This is a language specification, customized. If you want to use something else, you have to write your own code to handle this method. It is just like $a defining a variable. If you insist on %a defining one, it is absolutely fine, but you need Implement the explanation yourself.
给我你的怀抱2017-06-06 09:55:43
For example, there is a class in tp’s class library
Represents the PHP system-level namespace