JohnD Posted June 19, 2014 Share Posted June 19, 2014 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 More sharing options...
Antonio Conte Posted June 19, 2014 Share Posted June 19, 2014 Upgrade you dev environment. Much simpler than doing anything else. If that is not possible for any reason (you depend on 5.3 for other reasons, etc), reasearch how to work with multiple PHP versions on your system. Link to comment Share on other sites More sharing options...
JohnD Posted June 19, 2014 Author Share Posted June 19, 2014 Thanks for the reply. Link to comment Share on other sites More sharing options...
JohnD Posted June 30, 2014 Author Share Posted June 30, 2014 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 More sharing options...
Antonio Conte Posted June 30, 2014 Share Posted June 30, 2014 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 More sharing options...
JohnD Posted July 1, 2014 Author Share Posted July 1, 2014 OK Antonio. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts