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 Daily Exercise Program True PHP

Need help with this php quizz

Hello, I am having some issues with this quizz. I tried to assign the comparaison between $a and "5" to the variable $isIdentical. But it doesn't work. Can anyone help me? Thank you!

index.php
<?php
$a = 5;
//Place your code below this comment
$isBoolean = true;
$isIdentical = var_dump($a === "5");
echo $isIdentical;
?>

2 Answers

jamesjones21
jamesjones21
9,260 Points

you are almost there:

<?php
$a = 5;
//Place your code below this comment
$isBoolean = true;
$isIdentical = $a === "5";

to test this all you need to do is:

 var_dump($isIdentical);

Thank you! I thought this wouldn't work at the first place. That's why I didn't tried it.

jamesjones21
jamesjones21
9,260 Points

With var_dump, you don't require to echo it, it will dump the output onto screen.

So it doesn't return any value right?

jamesjones21
jamesjones21
9,260 Points

the variable you want to output needs to go inside of the var_dump($variable);