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

Donnie Driskell
Donnie Driskell
2,243 Points

Add 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); ?>

index.php
<?php

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

var_dump($integerOne + 5);
var_dump($integerTwo - 1);
?>
Donnie Driskell
Donnie Driskell
2,243 Points

ok, I see now. I just read about another person having same difficulty.

1 Answer

Antonio De Rose
Antonio De Rose
20,885 Points

why 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