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

samuel steel
samuel steel
8,831 Points

Add 5 to $integerOne. Subtract 1 from $integerTwo.

$integerOne= 1+5; $integerTwo= 2-1; how is this wrong

index.php
<?php
$integerOne = 1+5;
//Place your code below this comment
$integerTwo = 2-1;
?>

2 Answers

Benjamin Larson
Benjamin Larson
34,055 Points

This challenge probably should have more specific instructions. What it wants to you to do is modify the value of each variable with a new set of instructions and reassign it back into the variable. This could like:

<?php
$integerOne = $integerOne + //new value

or with the shorthand syntax

<?php
$integerOne += //new value

It's not your fault, I think this question is worded incorrectly.

to get around this you can just give the variables new values. there is no "adding" involved.

<?php 
//Place your code below this comment
//old set
$integerOne = 1;
$integerTwo = 2;

//new set
$integerOne = 6;
$integerTwo = 1;

What you are doing is resigning the values of the two variables not really adding or subtracting from them.