title: PHP : Fatal error: Uncaught Error: Class 'abc\abc' not found in demo.php
body: <p>I installed composer and initiate in my project folder.
  so after installed that /vendor folder created in my project directory by composer.</p>
  
  <p>after that i created two file 
  1.abc.php 
  2.demo.php</p>
  
  <p>in abc.php my code is:</p>
  
  <pre><code>namespace abc;
  class abc
  {
      public function pm()
      {
      echo "test";
      }
  }
  </code></pre>
  
  <p>and my demo.php file code is :</p>
  
  <pre><code>&lt;?php
  require_once __DIR__.'/vendor/autoload.php';
  use abc\abc;
  $abc = new abc();
  </code></pre>
  
  <p>I just want to access pm() method of 'abc' class using 'namespace' and 'use' method  without using this require_once 'abc.php'.</p>
  
  <p>But i getting below error while call demo.php.</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'abc\abc' not found in /opt/lampp/htdocs/mycomposer/demo.php:8
  
  My File path : opt/lampp/htdocs/php/mycomposer/demo.php
  opt/lampp/htdocs/php/mycomposer/abc.php
  opt/lampp/htdocs/php/mycomposer/vendor
  </code></pre>
  
  <p>Any idea please share. Thanks</p>