Looking for easy way to analyze var_dump (PHP) on large objects [closed]
Asked Answered
V

4

10

I know (PHP's) var_dump is supposed to be "human readable" and all, but analyzing large objects is just a pain in the neck. I am struggling to make sense of a few of the large objects that are being passed around in a script that we are running. (I know that using xdebug with and IDE is a good idea, but I have not been able to get xdebug to run on this project for some reason - several days lost, ugh).

Any ideas on how I can easily digest the contents of a really big var_dump? Any ideas are welcome... Although I am hoping that there is something similar to Thomas Frank's JSON tool (where you just put some code in and it gives a nice graphical representation).

Verrazano answered 19/3, 2010 at 16:0 Comment(1)
#2142085 here is a similar post with a couple good suggestionsGorgeous
P
5

You could take a look at FirePHP. It enables you to write information to the firebug-console. If you write an array or object to the log and hover with your mouse over it, you get a nice presentation of the contents of that array. Here is a screenshot of a simple example.

Perutz answered 19/3, 2010 at 16:13 Comment(1)
Looks like I already had FirePHP integrated in my project, so I used it. Very useful. It does exactly what I was looking for.Verrazano
I
13

I'd just use dBug.

Indiraindirect answered 19/3, 2010 at 16:7 Comment(2)
I was going to suggest dBug too. I include it in every project I make now, I can't imagine working without it.Shaunda
Thanks for sharing this. dBug looks really nice var_dump replacement. I must say that FirePHP seems a little more convenient since it doesn't muck up the entire webpage you are trying to debug. Cheers!Verrazano
P
5

You could take a look at FirePHP. It enables you to write information to the firebug-console. If you write an array or object to the log and hover with your mouse over it, you get a nice presentation of the contents of that array. Here is a screenshot of a simple example.

Perutz answered 19/3, 2010 at 16:13 Comment(1)
Looks like I already had FirePHP integrated in my project, so I used it. Very useful. It does exactly what I was looking for.Verrazano
R
2

I made a var_dump alternative you should like:

http://raveren.github.io/kint/

Screenshot demonstrating content-aware features:

Kint screenshot
(source: github.io)

Resh answered 24/3, 2011 at 18:27 Comment(0)
S
0

Interesting question. I'd make my own var_dump() equivalent based on some recursive function. With some parameters (such as nesting level, certain element name, etc) to pass it could be quite useful I think.

Sech answered 19/3, 2010 at 16:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.