Re: PHP debugger recommendations, anyone?
| From: | Nathan Nobbe | Date: | Sat, 09 Feb 2008 20:20:22 +0000 |
| Subject: | Re: PHP debugger recommendations, anyone? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269012@lists.php.net to get a copy of this message | ||
On Feb 9, 2008 3:02 PM, Nathan Rixham <nrixham@gmail.com> wrote:
> It suddenly dawned on me that you are doing an echo for every paremeter,
> a debugger will never completely alleviate the need for this, however
> try using:
> print_r(get_defined_vars());
> instead, that way you get everything output that you could need, it's
> often also worth putting an exit(); after prining out so you can see
> where the script is failing; if indeed it is.
>
get_defined_vars() can be a real hassle to sift through, mainly because it
spits out a bunch of data you dont usually want to see. if you want to see
the values of a given functions parameters w/o an echo statement for each
on the best way is to use, func_get_args();
eg.
die(var_dump(func_get_args()));
also, xdebug has something called function traces; which you dont need to
configure a client for. it will simply log all function calls to a file and
its
configurable, so you can have it log the values of actual parameters if you
like. and it also ships w/ a special highlighter for vim, which is quite
nice.
http://xdebug.org/docs/execution_trace
-nathan