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

the second task has become difficult i can't go on any longer i have tried everything but all i get is a bummer

i tried everything that i learnt in this course but nothing seems to work out all i get is a bummer please help me do this task I need to move onto the next

index.php
<?php

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

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

var_dump($integerOne + 5);
var_dump($integerTwo - 1);
?>

2 Answers

Adam Pengh
Adam Pengh
29,881 Points
<?php

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

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

echo $integerOne * $floatOne;
?>
Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Brolin,

The problem is not your syntax, as it is correct. However, it is not what the instructions are asking for. Challenges have very specific instructions, and they must be followed exactly or even correct syntax will result in a Bummer.

Task two wants you to add to the previously declared variables. The instructions do not say anything about making new variables (as you have done) or using the var_dump method.

There are two ways you can add to an existing variable:

  1. By reassigning like so: $variableOne = $variableOne + 5;
  2. Using the Increment/Decrement operator as such: $variableOne += 5; ** This method is much more DRY **

So, just delete the var_dump calls, and fix up those two lines, so you are not assigning the new values to the a different variable.

Other than that, Good Job! :) :dizzy: