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

John Kumar
John Kumar
13,937 Points

How am I supposed to add to $integerOne without changing task 1?

I tried var-dump to add both numbers but the Bummer! warning says that I did not change the $integerOne. This is confusing because when I try something to add to $integerOne other than var-dump I get a message that task one is no longer passing. I watched the videos twice and do not understand what the task is looking for.

index.php
<?php

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

?>

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey John,

First, you don't need to use var_dump. This function does not alter anything. It is simply used to print data. The challenge will always give a Bummer if you add (or delete) code that was not asked for in the instructions.

Now, for the second task, all you need to use is a combined operator. Combined operators take a variable and re-assigns a new value based on the combined operator and value used. Alena gives an example of this for adding to a variable in this video starting at ~4:58.

Hope this helps. :) :dizzy:

John Kumar
John Kumar
13,937 Points

Thank you Jason Anders I completed all tasks and earned my badge.