15
rehman
8y

The moment I learnt "print_r" and "die" in php my life become easier.

Comments
  • 2
    I prefer to use var_export, as it has a second optional parameter, allowing it to return as a string instead of printing, thus allowing me to do a error_log(var_export($object, true)) if nothing works, but I need the output 😊
  • 4
    Even var_dump() is better than print_r().
    And throwing exceptions is better than die().
  • 0
    I prefer to use krumo. Never looked back after I did.
  • 1
    Check Nette/Tracy on GH. Best. Debugging. Tool. Ever.
Add Comment