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 trialDonnie Driskell
2,243 PointsAdd 5 to $integerOne. Subtract 1 from $integerTwo.
Ok. I give up. the output (preview) has the correct answer int(6) int(1) However, the quiz gives me a bummer saying: "You haven't changed $integerOne" (Do what? - strange)
Add 5 to $integerOne. Subtract 1 from $integerTwo.
This is all of my code: <?php //Place your code below this comment $integerOne = 1; $integerTwo = 2; $floatOne = 1.5;
var_dump($integerOne + 5); var_dump($integerTwo - 1); ?>
<?php
//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
var_dump($integerOne + 5);
var_dump($integerTwo - 1);
?>
1 Answer
Antonio De Rose
20,885 Pointswhy have you used, var_dump, the question have not asked you to use var_dump, simply it had asked you to add 5 to the integerOne, and subtract 1 from integerTwo.
moreover, the value once it had added and subtracted on the respective variables, the variable containing the value, will have to change and hold on to the new value accordingly,
look into the site below, on how assignment operators work http://php.net/manual/en/language.operators.assignment.php
Donnie Driskell
2,243 PointsDonnie Driskell
2,243 Pointsok, I see now. I just read about another person having same difficulty.