Help documents can not be found, search is also very difficult to understand.
Novice tutorials do not understand.
What does use a\b mean?
I began to understand that:
After using the use \a\b, the definition of class,function will be defined under \a\b, and the experiment is found to be incorrect.
Also understood as:
Afunction () after using use \a\b;
Will call \a\b\afunction (); and found it wrong.
Excuse me, what does this mean?
In addition this site input \ Words, need to enter two \, that is, \ \ escaped.
//1.php
"; ///echo \a\b\c\value3; echo \a\b\c\value3;
//2.php
这个怎么报错呢?我哪里弄错了?
Reply content:
Help documents can not be found, search is also very difficult to understand.
Novice tutorials do not understand.
What does use a\b mean?
I began to understand that:
After using the use \a\b, the definition of class,function will be defined under \a\b, and the experiment is found to be incorrect.
Also understood as:
Afunction () after using use \a\b;
Will call \a\b\afunction (); and found it wrong.
Excuse me, what does this mean?
In addition this site input \ Words, need to enter two \, that is, \ \ escaped.
//1.php
"; ///echo \a\b\c\value3; echo \a\b\c\value3;
//2.php
这个怎么报错呢?我哪里弄错了?
use AB
this notation is used in namespaces, where the namespace is in the php5.3 is introduced after the
. The
Mesh is for convenience, canonical reference class, php5.3 previously referenced classes are through __autoload
to determine whether the class is introduced, if not introduced require (' ***.class.php ');
The automatic loading of classes is implemented in this way. The
now has namespaces that make the code look more prescriptive.
For example: a.class.php
class file to add a namespace, such as;
namespace app\a;
It is possible to introduce classes in any other file by using the use App\a;
method.
The hierarchical directory in another namespace is designed to make it easier for developers to know what directory the file is in, such as:
Define a namespace in /a/b/c/d/e.class.php
Namespase a\b\c\d\e;
In other files use a\b\c\d\e;
to know clearly which directory it is in.
Append: Landlord code error reasons have a few aspects.
1: The use of namespaces is primarily used in classes
2: Using the use will not include the
proposed landlord to look at the official documents, the use of the method is very comprehensive
Manual it says, "How could it not be found?"
Using namespaces: Aliases/imports