Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics Unit Converter Manipulating Numbers

Anja Leko
PLUS
Anja Leko
Courses Plus Student 510 Points

I 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"; ?>

index.php
<?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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi 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! :sparkles: