Jump to content
Larry Ullman's Book Forums

Recommended Posts

I'm looking for a work-around for the tDebug trait. In my dev environment, I am using php 5.3. In my production environment I am using php 5.4. Can you suggest a way of testing and developing traits in 5.3 that can then easily be converted to an actual trait in 5.4? Thanks, JD.

Link to comment
Share on other sites

  • 2 weeks later...

I can't change my dev version to php5.4. I'm stuck with php5.3. Can someone help me change the tDebug trait into a class that I can use to debug classes? I have tried myself. I can't figure it out. Thanks, JohnD

Link to comment
Share on other sites

You don't actually NEED traits to debug classes. My favorite debugging technique is to put objects or arrays into this:

echo '<pre>' , print_r($object, true) , '</pre>';

It should give you object names and display the object internals. If you want object methods, foreach get_class_methods(). If you want the same functionallity inside your objects methods (for whatever reason) simply create methods that call those functions Larry applies with $this as a parameter.

Link to comment
Share on other sites

 Share

×
×
  • Create New...