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

Cliff Jackson
Cliff Jackson
2,887 Points

Changing $integerOne value from 1 to 5.....no hints on challenge very frustrating...tried several ways

First time i have got stuck on a challenge and have tried various ways to change the value of $integerOne = 1 to add five to it but no luck....

index.php
<?php

//Place your code below this comment
$integerOne + 5;
var_dump ($integerOne);
$integerTwo - 2;
var_dump ($integerTwo);
$floatOne = 1.5;

?>

4 Answers

<?php

//Task 1
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;

//Task 2

$integerOne = $integerOne + 5;
$integerTwo = $integerTwo - 1;

/*
You're taking the variable $integerOne which you assigned it to 1 in the first task and
your adding 5 to that variable. Same with $integerTwo.  You're overwriting 
$integerOne and $integerTwo with the result of the equation.
So if you do a echo $integerOne; after task 2 it would echo out 6. Hope this 
helps you understand a little bit more.
*/
Cliff Jackson
Cliff Jackson
2,887 Points

I did try that once but i didn't remove the $float one on task 2 as it appeared on task 2, if task two does not involve $float one surely it should be omitted from the question.? Thanks anyway for the help.

Cliff Jackson
Cliff Jackson
2,887 Points

This still does not work

Cliff Jackson
Cliff Jackson
2,887 Points

Says task 1 is no longer passing although it is the same as before....crazy