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 trialDaron Anderson
2,567 PointsPHP Basics
I add 5 and minus 1 and I keep getting an error can anyone help?
<?php
//Place your code below this comment
$integerOne = 1 + 5;
$integerTwo = 2 - 1;
?>
4 Answers
Fahri Can
9,921 PointsWhat is the exact error message you get? Did you tried to echo both numbers?
Christopher Debove
Courses Plus Student 18,373 PointsYou need to do the operations in two step: Initialization and Update =>
<?php
$integerOne = 1;
$integerOne = $integerOne + 5;
?>
Scott Yardley
20,663 Points//Place your code below this comment $integerOne = (1 + 5); $integerTwo = (2 - 1);
Christopher Debove
Courses Plus Student 18,373 PointsNope, won't work with this challenge. The challenge is based on a specific method to do the operations.
EDIT : But your code is actually valid =)
Scott Yardley
20,663 Points$integerOne = 1; $integerOne +=5; $integerTwo = 2; $integerTwo -=1;