php get class name without namespace from string 1

php get class name without namespace from string


Here is what the above code is Doing:
1. The first line declares the namespace.
2. The next three lines define some code elements in the namespace.
3. The next two lines create instances of the class MyClass. The first one uses the unqualified name, and the second one uses the fully qualified name.
4. The next line calls the function strlen() from the global namespace.
5. The next line uses the namespace operator to access a constant in the current namespace.
6. The next line uses the namespace operator and the constant __NAMESPACE__ to dynamically construct the name of a constant in the current namespace.
7. The last line uses the constant() construct to read the value of a constant, which is in a namespace.

Similar Posts