title: PHP can not create instance of class with namespace
body: <p>I've got the following problem:</p>
  
  <p>This is my super basic class:</p>
  
  <pre><code>class A
  {
      function foo()
      {
          echo "bar";
      }
  }
  </code></pre>
  
  <p>Now in front of the class declaration I use the following code:</p>
  
  <pre><code>$a = new A();
  $a-&gt;foo();
  </code></pre>
  
  <p>When I open the php file in the browser, the output is "bar". Fine!</p>
  
  <p>Now I want to do the same thing in another file.</p>
  
  <p>directly in the first place I declare the following namespace:</p>
  
  <pre><code>namespace model\dbAction;
  </code></pre>
  
  <p>This is the path where my file with the class above is located.</p>
  
  <p>So in another php file I do the following:</p>
  
  <pre><code>$a = new \model\dbAction\A();
  $a-&gt;foo();
  </code></pre>
  
  <p>But I don't get any output and other code after that won't run so it looks like it breaks directly after the instancing of the class.</p>
  
  <p>Any ideas why instancing the class in another file is not working?</p>
  
  <p>Thanks!</p>
  
  <p>Full code first php file:</p>
  
  <pre><code>&lt;?php
  namespace model\dbAction;
  class A
  {
      function foo()
      {
          echo "bar";
      }
  }
  </code></pre>
  
  <p>Full code of the second file (which I call in the browser):</p>
  
  <pre><code>$a = new \model\dbAction\A();
  $a-&gt;foo();
  </code></pre>