title: PHP: is there an instance of class in use?
body: <p>I've caused a circular loop between a class and it's parent class.</p>
  
  <p>The only way I can think of to fix the problem is to test if there are instances of the child class in use. Is there anyway to test for that?</p>
  
  <p>So I took a break and came back the issue. The loop was caused by the __construct method in a class that deals with routing input to the appropriate logic. This class is then inherited by other classes so that if I need to do something automatically that would normally be done by the user I can implement it easily. </p>
  
  <p>What I didn't see happening was that each time a child class was called, this constructor was activated to reroute the user to the right code. Since the input was identical, it was sent back to child class, setting up the loop. I have solved the issue by taking out the constructor and calling the methods needed in the site index instead, so that child classes, no longer attempt to call themselves.</p>