title: Difference Between getcwd() and dirname(__FILE__) ? Which should I use?
body: <p>In PHP what is the difference between</p>
  
  <pre><code>getcwd()
  dirname(__FILE__)
  </code></pre>
  
  <p>They both return the same result when I echo from CLI</p>
  
  <pre><code>echo getcwd()."\n";
  echo dirname(__FILE__)."\n";
  </code></pre>
  
  <p>Returns:</p>
  
  <pre><code>/home/user/Desktop/testing/
  /home/user/Desktop/testing/
  </code></pre>
  
  <p>Which is the best one to use? Does it matter? What to the more advanced PHP developers prefer?</p>