title: php find where class is instantiated from
body: <p>I am having some issues on a large-ish project, and it boils down to a particular class is somehow being instantiated multiple times, which is causing un-needed replication / overheads.</p>
  
  <p>Is there any way to find out automatically what file / line number it is being instantiated from?</p>
  
  <p>I have seen this question here - <a href="https://stackoverflow.com/questions/1623913/find-where-a-class-was-instantiated">Find where a class was instantiated</a> but I am not getting a fatal error for it being redeclared so I dont think include / require is the problem.</p>
  
  <p>in the constructor I have got it to output to a txt file with timestamp, just need to know where the offending code is and remove / streamline it</p>