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

$integerOne = 1; $floatOne = 1.5; var_dump($integerOne * $floatOne); why doesn't this work in the Tasks quiz?

When I write this in Workspaces, I get the correct answer of float(1.5). When I try to enter this answer into the Tasks Quiz I receive the response "Bummer, integerOne is unchanged." Does anyone know why this isn't working? Thanks for your help!

index.php
<?php

//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
var_dump($integerOne);
$integerOne = $integerOne + 5;
var_dump($integerTwo);
var_dump($integerTwo--);

$integerOne = 1;
$floatOne = 1.5;
var_dump($integerOne * $floatOne);


?>

1 Answer

Steven Parker
Steven Parker
229,786 Points

Don't re-assign the variables back to their initial values. Task 3 is expecting to see the results based on the values they have after task 2.

Also, for the purpose of the challenge, you won't need to use any "var_dump"s. When it asks you to display the final result, use "echo".

Thank you, Steven. I'll give this a try.