debugging php in quick and lightweight environment

Share on Facebook
Post to Google Buzz
Bookmark this on Yahoo Bookmark
Share on StumbleUpon

Sometimes the debugger, xdebug, zend debugger, aren’t working. So instead debugging, we just spend time to debug the debugger itself.
To debug quickly in php we just need to call exit function with variable or any parameter we want. so the script stop and displaying what exactly in the exit parameter.
Example, suppose you want to know what happen with an array so you just type

1
2
3
4
5
<?php
include_once 'some_include.php';

exit("What's this : ".print_r($arr));
?>

that’s all for today.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>