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

I've multiplied the $integerOne by $floatOne using echo ($integerOne * $floatOne); and receive an error

Challenge Tasks 1 + 2 have been completed correctly. In Challenge task 3 I've added the above line. When I check the results it shows "9" which would suggest the code does what is asked of it (multiply 6 by 1.5). The error however says I should use echo instead of var_dump but that is exactly what I'm doing

index.php
<?php

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

$integerOne = $integerOne +5;
var_dump ($integerOne);
$integerTwo = $integerTwo -1;
var_dump ($integerTwo);

echo ($integerOne * $floatOne);

?>

2 Answers

Try removing everything from your script that the tasks never asked for. The system can be picky

Let me know if this helps here

Thanks! I removed some lines and it worked out. I thought the idea was to keep the 1/3 and 2/3 code that was there :)

Ya, the tasks never explicitly asked for var_dumping and that ended up catching up with you in task 3.

You can mark this question as solved by selecting a "best answer". :smile: