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 Datatypes Booleans

var_dump

I could not understand why var_dump is required when creating a TRUE or FALSE boolean.

2 Answers

Kevin Korte
Kevin Korte
28,148 Points

var_dump is never required. I think they were just showing you how the php interperater handles booleans like that. var_dump is a debugging function, it it literally just dumps out whatever you pass it, with the information around what it is.

Hello Kevin Korte is var_dump used in php programming regularly?

Kevin Korte
Kevin Korte
28,148 Points

I use it a lot. It's an easy way for me to see what information is exactly available to me at a given point in the program.

I'll often make a temp variable equal to a function or some other object so I can see what's inside, whether it's an array, or something else.