Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XDebug and VIM. Browsing array values

Tags:

vim

xdebug

Is there any way to browse the data inside an array?

Currently I can only see $data[0] = (array) with no way knowing what's inside the array.

I can the values inside normal variables fine.

Is there a way to see inside the arrays? Maybe a command I'm not aware of?

Edit:

I found out I can use the command keys ,e to evaluate an array or object.

After I type ,e an /*{{{1*/ => eval: prompt shows up then I can type /*{{{1*/ => eval: $data[0] to see the values.

Except I get it in the following output format:

/*{{{1*/ => eval: $data[0]

$command = 'eval';

EVAL_RESULT = (array) ;

EVAL_RESULT = (string) 'stringfromdata0-1' ;

EVAL_RESULT = (string) 'stringfromdata0-2' ;

EVAL_RESULT = (array) 'stringfromdata0-3' ;

This only does half of what I want it to do. Is there any way to output the keys of the array? It only shows me the values, but the keys are shown as "EVAL_RESULT" instead of the their perspective key names of the array.

like image 409
Tek Avatar asked Apr 04 '11 05:04

Tek


2 Answers

Edit debugger.vim file (~/.vim/plugin/debugger.vim) and find a line similar to

let g:debuggerMaxDepth = 1

increase the depth varibale to a reasonable amount (5 should be enough) save and restart vim.

like image 50
aminalid Avatar answered Nov 23 '22 04:11

aminalid


Also, you can wrap your expression in var_export(<expr>, true), and it will show you the full object.

like image 37
greasepig Avatar answered Nov 23 '22 03:11

greasepig