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

Matthew Cushing
Matthew Cushing
12,048 Points

"True PHP" Challenge not coming out right?

I honestly have no idea what I'm doing wrong. I'm assigning the variable $isIdentical to the comparison between $a and the string "5" using 3 ==='s to make sure it's "identical" but it doesn't seem to work..... The error is that it "cannot see the variable $isIdentical"

I've tried restarting browser and the challenge multiple times.

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

2 Answers

Try it without the var_dump

$isIdentical = "5" === $a;
Antonio De Rose
Antonio De Rose
20,884 Points

you are correct, but may I ask, why do you need a var_dump, does the question ask for it, was it a typo, or by intention.

Matthew Cushing
Matthew Cushing
12,048 Points

Honestly, just following the video. Video doesn't show you doing a boolean without var_dump. I assumed you had to use var_dump in order to compare.