I usually, test code with PHP code, special PHP variables with var_dump and print_r
But I always end up placing them everywhere and messing up the code.
Is it common to include them or place them in an organised way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why not wrap every
var_dumporprint_rin this way:Then you can set
$debug = trueat the top of every file – or even better, in a file that is included by every other file, so that you can globally turn debugging on or off. You can also programatically set the debug flag like this: