title: Class not being found with PSR-4 and Composer
body: <p>I'm trying to understand how to use PSR-4 with Composer. I have 3 folders in my project: <code>folder</code>, <code>folder2</code> and `vendor. Outside all these folders there's four files: index.php, composer.phar, composer.json and X.php. Some of these files are descibed below:</p>
  
  <p>index.php
      
  
  <pre><code>require_once 'vendor/autoload.php';
  
  use \folder\in\A;
  use \folder\in\B;
  use \folder\C;
  use \folder2\D;
  
  $a = new A();
  $b = new B();
  $c = new C();
  $d = new D();
  $x = new X();
  </code></pre>
  
  <p>X.php</p>
  
  <pre><code>&lt;?php
  
  class X {
          public function __construct() {
              echo "Classe X";
          }
  }
  </code></pre>
  
  <p>composer.json</p>
  
  <pre><code>{
      "autoload":{
          "psr-4": {
              "folder\\": "folder/",
              "folder2\\": "folder2/"
          }
      }
  }
  </code></pre>
  
  <p>The index.php file is working well for the files that are in folder and folder2, but the X.php is not being found. What's the problem? How I can found the X.php file in index.php using Composer and PSR-4? I can found the X.php file using require_once, though, but I want to know how to this with Composer and PSR-4.</p>