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 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: