title: class_exists with namespace not working PHP 7.2
body: <p>I can't get class_exists to see my class file.</p>
  
  <p>More annoyingly, if I actually include the class file directly, it moans that I can't include it as the class already exists! Talk about a slap in the face.</p>
  
  <p>There's obviously a lot of parts to this so I'll just try to include the relevant bits :</p>
  
  <p>The class I'm checking for is <strong>Posts.php</strong> in a function inside Router.php</p>
  
  <p>Dir structure :</p>
  
  <pre><code>app
  |
  ---&gt;Project
     |
     |---&gt;Controllers
     |   |
     |   ---&gt;Posts.php
     |
     |---&gt;Core
     |   |
     |   ---&gt;Router.php
  </code></pre>
  
  <p>The class name (controller) is being pulled from a part of the query string and it is tested and working. ie - mysite.com/posts/view will result in the class name being passed as "Posts" just as it should be for psr4.</p>
  
  <p>The part of the router dispatch function where the trouble lies.</p>
  
  <pre><code>if (class_exists($controller)) {
      $controller_object = new $controller();
  
   } else {
        echo "Controller class $controller missing";
   }
  </code></pre>
  
  <p>I've tried including the class directly, like I said, I get get a warning about including the same class twice.</p>
  
  <p>I've also tried using the class constant :</p>
  
  <pre><code> if (class_exists($controller::class)) {
  </code></pre>
  
  <p>But got : </p>
  
  <pre><code>Fatal error: Dynamic class names are not allowed in compile-time
  </code></pre>
  
  <p>And also tried using the full namespaced url to it :</p>
  
  <pre><code>if (class_exists('Project\\Controllers\\' . $controller))
  </code></pre>
  
  <p>But again, class not found.</p>
  
  <p>Here is Posts.php</p>
  
  <pre><code>namespace Project\Controllers;
  
  class Posts
  {
  
      public function index()
      {
          echo 'It Works';
      }
  
  }
  </code></pre>
  
  <p>Am I missing something obvious here?</p>