Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics (Retired) PHP Operators Comparison Operators

Luca Spezzano
Luca Spezzano
10,417 Points

var_dump?

I didn't understand why with the var_dump it print the result? any help? maybe var_dump always print what is inside()?

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hi there, Luca,

Yes I think you've got it right, var dump is a pre build PHP function that displays the contents including the type of variable.

So you could use it to inspect the contents of an array, or a variable or an object.

As i recall the output would be something like this

one[0], => two[1]

It's just a list of what makes up a particular object. :-)