title: Can't call global class from namespaced class in PHP. Using Composer's autoload
body: <p>I'm using composer to create an autoload file, and all that jazz works as expected.</p>
  
  <p><strong>The problem is</strong>: <em>when I try to call a globally defined class, it keeps looking inside the namespace, instead of the global scope. Even though I use the \ escape as in "new \WC_Order();"</em></p>
  
  <p>I've configured composer.json to autoload MyNamespace in the correct dir and include 'vendor/autoload.php' in my wordpress theme's function.php, and create a new instance, which works. Everything about this process works.</p>
  
  <pre><code>include 'vendor\autoload.php';
  $myclass = new MyNamespace\MyClass()
  </code></pre>
  
  <p>Here's where the error occurs in the file 'MyNamespace\MyClass.php:</p>
  
  <pre><code>namespace MyNamespace;
  
  class MyClass {
  
      public function __construct()
      {
          $order = new \WC_Order(1234);
      }
  
  }
  </code></pre>
  
  <p>PHP throws a fatal error:</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'MyNamespace\WC_Order' not found in ...\MyNamespace\MyClass.php
  </code></pre>
  
  <p>Any tips or hints would be greatly appreciated!</p>
  
  <p>Edit: My composer/directory setup</p>
  
  <p>composer.json</p>
  
  <pre><code>{
      "autoload": {
          "psr-4": {
              "MyNamespace\\": "MyNamespace"
          }
      },
      "require": {
          "guzzlehttp/guzzle": "^6.3"
      }
  }
  </code></pre>
  
  <p>functions.php is in the root and the class is in MyNamespace/MyClass.php</p>