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 Build a Simple PHP Application Wrapping Up The Project Objects

What is wrong with my conditional statement?

<?php include("class.palprimechecker.php"); $checker = new palprimechecker(); $checker->number = 17;

echo "The number". "$checker->number(17)" . " "; if($checker->isPalprime()) { echo "is"; } else { echo "is not"; } echo " a palprime.";

?>

1 Answer

You don't need to pass a value to ->number since it's defined in $checker. You don't need the " before the $checker->number(17) since what goes after your concatenating is a variable and not a string. You should also delete the . " " directly after the number()