title: Find out where a function comes from?
body: <p>From time to time, I'm handed bloated, undocumented, buggy PHP code to fix. I have several tools I use to fix such code as quickly as possible.</p>
  
  <p>One thing I'm not sure how to do that occasionally causes me grief is finding where a function is located (in which file it is defined). Note that I don't want to know where a function is called <em>from</em>.</p>
  
  <p>For example I'd like to be able to do this:</p>
  
  <pre><code>//file1.php
  function foo(){
      echo 'bar';
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>//file2.php
  where_is_function('foo');//error
  include('file1.php');
  echo where_is_function('foo');//outputs'file1.php'
  </code></pre>