Last active
August 1, 2018 03:37
-
-
Save RufusTJohnson/f7d32742656dc34942c81218b512d1e2 to your computer and use it in GitHub Desktop.
Demonstrate How Namespaces Affect Fully Qualified Classnames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace This\Is\A\Long\Name_Space; | |
| echo '<span style="text-decoration: underline;">Demo the effect of namespaces on fully qualified class names</span>'; | |
| class handler{} | |
| // Post the fully qualified name of the handler class defined in this namespace | |
| echo "<br><br><HR>".handler::class."<br>"; | |
| namespace Short\Name_Space; | |
| class handler{} | |
| // Post the fully qualified name of the handler class defined in this namespace | |
| echo "<br><br><HR>".handler::class."<br>"; | |
| ?> | |
| Output | |
| ------ | |
| Demo the effect of namespaces on fully qualified class names | |
| This\Is\A\Long\Name_Space\handler | |
| Short\Name_Space\handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment