title: Get filename and line number of start of function declaration
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2222142/how-to-find-out-where-a-function-is-defined">How to find out where a function is defined?</a><br>
    <a href="https://stackoverflow.com/questions/4805521/included-php-file-to-know-its-file-name">included php file to know it&#39;s file name?</a>  </p>
  </blockquote>
  
  
  
  <p>Can I get the <strong>filename</strong> and <strong>line number</strong> of the start of a function declaration in PHP?</p>
  
  <p>Say, I have the following code:</p>
  
  <pre><code> 1. /**
   2.  * This function shows the foo bar.
   3.  */
   4. function foo_bar($subject) {
   5.     echo "Foo bar:\n";
   6.     if ($subject == "none") {
   7.         trigger_error("Wrong argument given to 'foo_bar()' in ... on line ....", E_USER_WARNING);
   8.     }
   9.     ...
  10. }
  </code></pre>
  
  <p>When I call <code>foo_bar("none")</code>, the function must throw an error like this:</p>
  
  <blockquote>
    <p><strong>Warning:</strong> Wrong argument given to 'foo_bar()' in /home/web/mcemperor on line 4.</p>
  </blockquote>
  
  <p>Can I retrieve the <strong>filename</strong> and the <strong>line number</strong> of start of the function declaration?</p>