title: PHP how to import class with namespace
body: <p>I have never used namespaces in PHP before and I cannot import some library classes that use them. I'm trying to use the <a href="https://github.com/wsdl2phpgenerator/wsdl2phpgenerator" rel="nofollow">wsdl2php</a> library, here is the example code on how to use the library:</p>
  
  <pre><code>$generator = new \Wsdl2PhpGenerator\Generator();
  $generator-&gt;generate(
    new \Wsdl2PhpGenerator\Config(array(
      'inputFile' =&gt; 'input.wsdl',
      'outputDir' =&gt; '/tmp/output'
    ))
  );
  </code></pre>
  
  <p>However, it doesnt matter where I put my php file that executes this code, it always throws class not found error, even if I include both classes with <code>include</code> or <code>require</code>, then the library class will throw class not found error, since it wants to use yet another library class.</p>
  
  <p>Here is some directory tree for reference:</p>
  
  <pre><code>[src]
      [Filter]
          DefaultFilter.php
          ...
      [Wsdl2PhpGenerator]
          [Console]
              Applicaton.php
              ...
      ...
      Config.php
      Generator.php
      my_php_file_here.php
  </code></pre>
  
  <p>namespace declaration in Config.php: <code>namespace Wsdl2PhpGenerator;</code> How <code>use</code> is used in Config.php:  <code>use Wsdl2PhpGenerator\ConfigInterface;</code></p>
  
  <p>From what I have seen, I have added the following to the start of my php file:</p>
  
  <pre><code>namespace Wsdl2PhpGenerator;
  
  use Wsdl2PhpGenerator\Generator;
  use Wsdl2PhpGenerator\Config;
  </code></pre>
  
  <p>With no success, I still get</p>
  
  <pre><code>Fatal error: Class 'Wsdl2PhpGenerator\Generator' not found in C:\kajacx\programming\PHP\EET\test\wsdl2phpgenerator-master\src\kappa.php on line 8 ($generator = new \Wsdl2PhpGenerator\Generator();)
  </code></pre>
  
  <p>So, how to make this work?</p>