Skip to content

Instantly share code, notes, and snippets.

@bulton-fr
Last active May 27, 2018 11:26
Show Gist options
  • Save bulton-fr/d19060cbb1bc97bc9e0171d991eede43 to your computer and use it in GitHub Desktop.
Save bulton-fr/d19060cbb1bc97bc9e0171d991eede43 to your computer and use it in GitHub Desktop.
<?php
namespace Foo {
use Bar;
class Foz {
public function run() {
return new Bar;
}
}
}
namespace Foo {
class Bar {}
}
namespace {
class Bar {}
$foa = new \Foo\Foz;
var_dump($foa->run()); //object(Bar)#2 (0) { } ... So \Foo\Bar is never used :/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment