After beating my head against the wall trying to get Zend debugging working, I gave up and discovered Kint. It slips straight in and you'll be happily digging through tracebacks and var dumps in a few minutes.
The awesome...
project page is here:
http://raveren.github.io/kint/
git url is here:
https://github.com/raveren/kint.git
var dumps look like this:
tracebacks look like this:
How to begin the awesome...
1. clone kint:
mkdir /your-modx-root/assets/lib
git clone https://github.com/raveren/kint.git /your-modx-root/assets/lib/
chown -R www-data:www-data /your-modx-root/assets/lib
2. require in your snippet:
require_once($modx->config['base_path'] . 'assets/lib/kint/Kint.class.php');
3. begin debugging like a pro:
d($_SERVER); //displays cool styled var_dump (with extra info)
dd($_SERVER); //like "var_dump($_SERVER); die;"
dd(debug_backtrace()); //my god
4. ... ?
5. profit!