title: Replace PHP's realpath()
body: <p>Apparently, <code>realpath</code> is very buggy. In PHP 5.3.1, it causes random crashes.
  In 5.3.0 and less, <code>realpath</code> randomly fails and returns false (for the same string of course), plus it always fails on <code>realpath</code>-ing the same string twice/more (and of course, it works the first time).</p>
  
  <p>Also, it is so buggy in earlier PHP versions, that it is completely unusable. Well...it already is, since it's not consistent.</p>
  
  <p>Anyhow, what options do I have? Maybe rewrite it by myself? Is this advisable?</p>