Created
August 1, 2015 07:41
-
-
Save bjzhush/e318928d91007de2e042 to your computer and use it in GitHub Desktop.
Using namespaces: fallback to global function/constant
This file contains 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 A\B\C; | |
class Exception extends \Exception {} | |
$a = new Exception('hi'); // $a is an object of class A\B\C\Exception | |
$b = new \Exception('hi'); // $b is an object of class Exception | |
$c = new ArrayObject; // fatal error, class A\B\C\ArrayObject not found | |
//http://php.net/manual/en/language.namespaces.fallback.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment