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!
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
TJ Smith2,240 Points
at the end it is saying bool.false when I run the script.
This is my code as I thought I followed along with the instructor. <?php $name = 'Tj'; $string_one = "Learning to display \"Hello $name!\" to the screen.\n"; $string_one = 'Learning to display'; $string_one.='" Hello '; $string_one.= $name; $string_one.= '!" to the screen.'; //$string_one = $string_one . "\n"; //prepend to a string //$string_one = 'I am ' . $string_one; echo $string_one;
$isReady = true; //var_dump($isReady); $isReady = false; //var_dump($isReady);
//var_dump(1 + "2");
$a = 10; $b = '10';
//var_dump($a == $b); //var_dump($a === $b);
var_dump($string_one == 'Learning to display "Hello Alena!" to the screen.'); ?>
Ryan S27,276 Points
Please see the formatting guidelines in the Markdown Cheatsheet to make your code more readable. It can be tricky to debug otherwise.
But the reason the var_dump is returning false is because your conditional expression evaluates to false.
You have defined
$name = 'Tj' at the beginning of the script, but you are checking for "Alena" as the value of
$name in your var_dump call.
Lengthy strings that have been concatenated over a number of lines can get confusing and it is easy to miss things. But when comparing variables and values, everything needs to be exactly correct.
Hope this helps.