title: PHP equivalent for a python decorator?
body: <p>I want to be able to wrap a PHP function by another function, but leaving its original name/parameter list intact.</p>
  
  <p>For instance:</p>
  
  <pre><code>function A() {
      print "inside A()\n";
  }
  
  function Wrap_A() {
      print "Calling A()\n";
      A();
      print "Finished calling A()\n";
  }
  
  // &lt;--- Do some magic here (effectively "A = Wrap_A")
  
  A();
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Calling A()
  inside A()
  Finished calling A()
  </code></pre>