title: Trigger an event when a function is called in a class
body: <p>Is is possible in PHP to trigger an event whenever a function in a class is called, without adding it to every function in the class?</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;?php
      class A {
          function xxx() {
              //this function will be called everytime I call another function in this class  
          }
  
          public static function b() {
              return 'Hello Stackoverflow!';
          }
  
          public static function c() {
              //I also want this function to trigger the event!
          }
      }
  
      echo A::b();
  ?&gt;
  </code></pre>