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

Nicholas Chetto
Nicholas Chetto
4,221 Points

pretty sure the system is funky out or I'm just doing it wrong but I know I'm close anyone help please?.

Create a new variable name $isIdentical. Compare the variable $a as equal and of the same type as the string "5" and assign the results to $isIdentical.

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

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Nicholas,

You are on the right track and have all the pieces, there are just couple things out of place and one small error.

First, the challenge does not ask for a vardump(), so that line needs to be deleted. Instructions are very specific and if not followed explicitly, the task will always return a Bummer even if code is correct.
The Instruction want the comparison asked for to be stored in the variable $isIdentical, but you are hard-coding a value there instead.

Second, the instructions do state that it wants a comparison to be equal and same type (===), but you are only checking for equal (==).

Because you do have all the correct code (once the == is changed to ===), I have provide the corrected code snippet for the challenge for you to review with the above notes.

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

Hopes this helps to clear things up. :)

Keep Coding! :dizzy:

Andres Ramirez
Andres Ramirez
18,094 Points

Hi Nicholas,

I was struggling with this answer as well. I don't remember anywhere in the videos using two equalities in the same line. Where can I find this explained more in detail?

Thanks!