Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,109 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,109 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.