title: PHP Aliasing/Importing: Global Access or Alias?
body: <p>In PHP, there seem to be the following ways of aliasing/using a class, in this example a class residing at <code>\Foo\Bar</code>.</p>
  
  <pre><code>// access via global namespace
  $bar = new \Foo\Bar;
  
  // switch into namespace (probably worst option)
  namespace Foo;
  $bar = new Bar;
  
  // alias namespace
  use Foo;
  $bar = new Foo\Bar;
  
  // alias specific class
  use Foo\Bar;
  $bar = new Bar;
  </code></pre>
  
  <p>The two most common options seem to be the access via the global namespace (first option) or aliasing a specific class (last option). When should I use one over another?</p>
  
  <p>Are there any established best practices in the industry?</p>