Skip to content

Instantly share code, notes, and snippets.

@gohanman
Created September 18, 2014 18:28
Show Gist options
  • Save gohanman/1a0b1ace7a077871872c to your computer and use it in GitHub Desktop.
Save gohanman/1a0b1ace7a077871872c to your computer and use it in GitHub Desktop.
<?php
namespace Project\API {
class Foo
{
// actual functionality here
}
}
namespace {
// wrapper in global namespace
class Foo extends \Project\API\Foo { }
}
<?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