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

Maria H
Maria H
6,737 Points

I am confused, receiving Make sure you use "echo" instead of "var_dump" error

I don't think I have seen an example of using echo to multiply integers so am not sure what I am doing wrong.

index.php
<?php

//Place your code below this comment
 $integerOne = 1;
  $integerTwo = 2;
 $floatOne = 1.5;

var_dump ($integerOne +=5);

var_dump ($integerTwo -=1);

var_dump($integerOne * $floatOne);
?>

3 Answers

Mike Whitney
Mike Whitney
381 Points

Thank you Maria H, you saved me this morning! I believe the wording on the question should be more clear as the concepts in the previous lesson do not explain this very well.

Maria H
Maria H
6,737 Points

I've been saved by other peoples questions too, sometimes just reading the problem from a different perspective helps. I'm glad you figured it out! Double checking your code with a PHP Validator can be helpful too.

https://phpcodechecker.com/ is a good tool.

jamesjones21
jamesjones21
9,260 Points

Hi Maria,

var_dump() outputs the variable in a readable format, which is useful for looking at arrays or a variable that will not be output to the screen.

you are almost there :)

In this challenge, you will require to use the keyword echo:

echo $integerOne +=5;
echo $integerTwo -=1;
echo $integerOne * $floatOne;
Maria H
Maria H
6,737 Points

I tried and was still recieving an error code( Bummer: Are you sure you multiplied $integerOne by $floatOne? This should be the same as 6*1.5 which equals 9).

When I removed echo from $ integerOne and $integerTwo and only echoed out the last equation it worked.

$integerOne +=5; $integerTwo -=1; echo $integerOne * $floatOne;