title: Forward and backward slash php
body: <p>I have an existing laravel project. I am running it on windows 10 machine. I am running the following command</p>
  
  <pre><code>cd c:/xampp/htdocs/demo/ (A file called index.php is there inside demo folder)
  
  php -S localhost:8000
  </code></pre>
  
  <p>index.php file has contents as follows</p>
  
  <pre><code>&lt;?php
   $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
   $uri = urldecode($uri);
   $paths = require __DIR__.'/bootstrap/paths.php';
   $requested = $paths['public'].$uri;
   // This file allows us to emulate Apache's "mod_rewrite" functionality from the
   // built-in PHP web server. This provides a convenient way to test a Laravel
   // application without having installed a "real" web server software here.
   if ($uri !== '/' and file_exists($requested))  
    {
      return false;
    }
    require_once $paths['public'].'/index.php';
  ?&gt;
  </code></pre>
  
  <p>Now the problem is with <strong>__DIR__</strong> . When I am trying to print the path it is the mixing of both forward and backward slashes.</p>
  
  <p>For example ($requested)</p>
  
  <pre><code>C:\xampp\htdocs\demo\bootstrap/../public/ 
  </code></pre>
  
  <p>This don't let the app running and throws <strong>internal server error(500)</strong></p>
  
  <p>Many places in the project has <strong>__DIR__</strong> . I can't replace it in one place. </p>
  
  <p>Can anybody help.</p>