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
Because...this is the syntax of php...
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.
Why challenge? Or question? PHP syntax. .
For example, there is a class in tp’s class library
Represents the PHP system-level namespace