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

Oops! It looks like Task 2 is no longer passing.

Why is Task 2 no longer passing?

index.php
<?php

//Place your code below this comment

$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;

$integerOne += 5;
$integerTwo -= 1;

$integerOne *= $floatOne;
echo $integerOne;
echo $integerTwo;

?>

2 Answers

Kieran Barker
Kieran Barker
15,028 Points

Your code for Task 3 should be:

echo $integerOne * $floatOne;

What you’ve done is assign the result of $integerOne * $floatOne back into $integerOne and then echoed $integerOne and $integerTwo.

This:

$integerOne *= $floatOne;

produces the same result as:

$integerOne * $floatOne;

You nailed it bro! Thanks! (Ultimately, the problem was that the challenge course was telling me that Task 2 was no longer passing, but the truth was that I just didn't execute task 3 properly.) Thanks again!

This is absolutely right! Thank you Kieran!

  • You only need to echo one thing here
  • You're not echoing the right thing
  • Looks like the challenge wont accept a solution using the *= operator. Use regular multiplication instead

Let me know if this helps here

Hey Adam! Thank you for taking the time to reply man! The echo of $integerTwo was just me testing things in desperation trying to figure out why task two $integerOne += 5; and $integerTwo -= 1; was no longer valid. I did try using regular multiplication, but that didn't work either. You and Kieran got it right with your posts below - I was assigning the value of $integerOne * $floatOne to $integerOne, rather than just displaying the results of the multiplication problem. Ultimately, the problem was that the challenge course was telling me that Task 2 was no longer passing, but the truth was that I just didn't execute task 3 properly. Thank you so much for your help!

np! You can mark this question as solved by choosing a "best answer". :smile: