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

When I enter the correct code for task 3 it says "task 2 is no longer correct"

The code is attached. Everything works perfectly, then when I add the last line of code, it says that the rest is no longer correct.

index.php
<?php

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

?>

NEVER MIND! I figured out what I was doing wrong. Stupid mistakes!!!!!

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You've got the right idea, but at the end of Task 2 the value of $integerOne should be 6. Step 3 does not ask you to alter the value of $integerOne but rather simply display the results of $integerOne times $floatOne.

So, if I erase $integerOne = from your echo line, we can get rid of that error.

When that is done, you will get a Bummer! about using var_dump and you will need to erase the var_dump from your code while keeping the assignments the same.

:bulb: Challenges are very strict and checking for specific things. Try not to do anything the challenge doesn't explicitly ask for. If it doesn't say to print something or to var_dump it, it's best not to. Even if functional outside the challenge, it can cause the challenge to fail.

Hope this helps! :sparkles:

Thanks. Right after I put this up I realized the problems and corrected them. Then I felt like an idiot. LOL.