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

I don't really understand it

I don't really understand what the task wants from me. Can someone help pls?

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

$isIdentical = '5';

var_dump($a == $isIdentical);


?>

"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."

2 Answers

I think the answer here is:

$isIdentical = ($a === "5")

So first you need to check if $a and the string "5" is equal + of the same type (using something like ===). Then you need to assign the answer of that into $isIdentical

Haven't actually watched this video yet, but you could give it a shot ?

Thank you so much Sinead! (you don't know how I'm happy right now haha)

M Glasser
M Glasser
10,868 Points

Got stuck here as well! Realizing now that var_dump() is a function that returns the kind and value of whatever is passed into the parentheses (a.k.a. arguments). So, $isIdentical effectively gets declared as a boolean variable once the strict comparison operator is used in Sinead's example. If we take a var_dump on $isIdentical (sorry couldn't resist) then it should return "boolean(false)" to the console since it's purpose is to "dump" information about the variable. In this case we have a variable that is a boolean and it's value is false. More about var_dump here: http://php.net/manual/en/function.var-dump.php