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 trialMiguel Nunez
3,266 PointsAdd 5 to $integerOne. Subtract 1 from $integerTwo.
//Place your code below this comment $integerOne = 1; $integerTwo = 2;
5 Answers
Daniel Gauthier
15,000 PointsHey Miguel,
The challenge is looking for the following code:
<?php
//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$integerOne += 5;
$integerTwo -= 1;
?>
The challenge basically wants to see you use those += and -= operators, while also showing you know the difference between initializing a variable (first step) and manipulating them (second step).
Good luck with the course!
deandede
1,433 PointsThe Longer way xD
<?php
//Place your code below this comment
$integerOne=1;
$integerTwo=2;
$floatOne=1.5;
$integerOne=($integerOne + 5);
$integerTwo=($integerTwo - 1);
?>
Took me some time to understand, but also found out this post. never thought of using the += or -= operators and also the question was bit confusing, but somehow this worked, thereafter i just wanted to see if there was any other answer, thanks to this post i found a shorter way to complete the same question.
Adios Daniel Gauthier thanks man..thanks alot xD
Enea Jorgji
6,038 PointsI was trying the short way, but it took me some time to understand xD
Jordan Rich
1,979 PointsFor more context this is part of the Assignment Operators http://php.net/manual/en/language.operators.assignment.php
Greg Sargent
3,942 PointsWow I would never have thought to use those operators. Thanks for sharing!
Fernando Diaz
PHP Development Techdegree Student 625 PointsThank you! I wouldn't have figured out to use those operators either
Daron Anderson
2,567 PointsDaron Anderson
2,567 PointsThank You Daniel For the answer it helped, and thank n.you Miguel for asking the question!