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 trialAnja Leko
Courses Plus Student 510 PointsI don't understand why this is incorrect?
<?php
//Place your code below this comment $integerOne = 1; $integerTwo = 2; $floatOne = 1.5; $integerOne = $integerOne + 5; $integerTwo = $integerTwo - 1; var_dump ($integerOne); var_dump ($integerTwo); $sum = $integerOne * $floatOne; var_dump ($sum); echo "$sum"; ?>
<?php
//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
$integerOne = $integerOne + 5;
$integerTwo = $integerTwo - 1;
var_dump ($integerOne);
var_dump ($integerTwo);
$sum = $integerOne * $floatOne;
var_dump ($sum);
echo "$sum";
?>
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! The challenge is expecting you display exactly one number, but you are also using a series of var_dump
which is displaying those values as well along with other information about the variables.
Take a look at the Bummer! message:
Bummer! Make sure you use "echo" instead of "var_dump"
Erasing all the lines with the var_dump
causes your code to pass the final step. Hope this helps!
Anja Leko
Courses Plus Student 510 PointsHi, thank you, that was the problem :)