title: Best practices to get Base-URL and Absolute-Path
body: <p>I know there a some questions about the subject, but they all contain different answers. I am wondering what is most efficient way to get the base url and absolute path as of 5.4 +</p>
  
  <p>Absolute path: Using magic constant</p>
  
  <pre><code>define('ROOT', __DIR__); //C:\wamp\www
  </code></pre>
  
  <p>Alternatively write the path yourself once</p>
  
  <pre><code>define('ROOT', 'C:\wamp\www');
  </code></pre>
  
  <p>Final use:</p>
  
  <pre><code>require ROOT . '/blabla/test.php';
  </code></pre>
  
  <p>How should I receive the absolute path otherwise? What option would be most efficient unless there aren't any better method?</p>
  
  <p>About the base url, I'm not quite sure how to generate the url.</p>