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

Ali Corlett
PLUS
Ali Corlett
Courses Plus Student 1,359 Points

php integer. I have to add 5 to $integerOne. I have done this and it says I have not, despite the answer being correct

what am I missing?

index.php
<?php

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

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

2 Answers

I think it actually wants you to reassign the new value to $integerOne like so

$integerOne += 5;

Since you're not actually storing the value, when the Challenge checks $integerOne and expects to see 6 it's still returning 1

Ali Corlett
PLUS
Ali Corlett
Courses Plus Student 1,359 Points

Hi Mike, thanks for the tip. I will try it out now. Ali