title: Is it possible to see if a class calls a method without first instantiating it?
body: <p>I'd like to know if a class is going to call a certain method, but I want to know before instantiating the class. Is this possible? </p>
  
  <p>Example: class <code>Controller_Index</code> calls <code>$this-&gt;composite('SomeCompositeClass')</code> within its <code>__construct()</code> method. Class <code>SomeCompositeClass</code> has a <code>helloWorld()</code> method. I want to see if I can call <code>Controller_Index-&gt;helloWorld()</code>.</p>
  
  <p>Basically I want to see if my controller is going to add any composite classes (by using <code>$this-&gt;composite()</code>), so that I may check if those composite classes contain the method I'm requesting (<code>helloWorld()</code>). And I'd like to do this without having to first instantiate <code>Controller_Index</code>.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Edit</strong><br>
  I suppose what I want to do is similar to using PHP's Reflection classes to see if a class method exists. But I don't want to know if the method exists, I want to know if the class calls it.</p>
  
  <p><strong>Edit 2</strong><br>
  Interfaces won't help because I won't necessarily call <code>$this-&gt;composite()</code> from every controller. </p>
  
  <p>Perhaps I just need to rethink the problem and go with a different approach.</p>