Created
September 18, 2014 18:28
-
-
Save gohanman/1a0b1ace7a077871872c to your computer and use it in GitHub Desktop.
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 Project\API { | |
class Foo | |
{ | |
// actual functionality here | |
} | |
} | |
namespace { | |
// wrapper in global namespace | |
class Foo extends \Project\API\Foo { } | |
} |
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 | |
include('path/to/autoloader.php'); | |
// both work, assuming autoloader knows the | |
// wrapper classes exist | |
$foo = \Project\API\Foo(); | |
$foo = Foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment