How can I get the caller function name in my class?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2110732/how-to-get-name-of-calling-function-method-in-php">How to get name of calling function/method in PHP?</a>  </p>
</blockquote>



<p>So in PHP I'm trying to build a custom error handler class. It's pretty simple:
I give it a code number and it gives back a formatted error message which I can use to send to mobile devices.</p>

<p>So it looks like this now:</p>

<pre><code>class Errorhandler {
   private $errors = array(
       //here be error codes and messages
       100 =&gt; 'Missing input or parameter!'
  );

   public function __construct($code = 100){
        //return formatted output
   }
}
</code></pre>

<p>So I'd use the class above like:</p>

<pre><code>public function someFunction(){
    //some conditions met, then throw an error
    $handler = new ErrorHandler();
    $this-&gt;response = $handler;        
}
</code></pre>

<p>So I'd need the parent function's name (someFunction) in my Errorhandler class so I can return it with the formatted error message.
On a side note: I don't want to use parameters for this, too much writing there.</p>
