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,243 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,243 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,243 Points

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