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

Andrew Merrick
Andrew Merrick
20,151 Points

Code Challenge: Objects 5/7

Unable to proceed with section 5/7 of Code Challenge: Objects.

Any ideas as to why? Thanks!

    <?php

    require_once("class.palprimechecker.php");
    $checker = new PalprimeChecker;
    $checker->number = 17;
    echo "The number . $checker->number . " ";
    if($checker->isPalprime()) {
        echo " is ";
    } else {
        echo " is not ";
    }
    echo " a palprime.";
    ?>

1 Answer

Chase Lee
Chase Lee
29,275 Points

Your problem is not the conditional. But in fact your quotes. You need to put a space and a double quote right after: "The number.

Randy Hoyt
Randy Hoyt
Treehouse Guest Teacher

Chase is correct. You need to end the string "The number " with a double quotation mark before you concatenate the property to it, like this:

"The number " . $checker->number . " ";
Andrew Merrick
Andrew Merrick
20,151 Points

::facepalm:: Thank you, Chase and Randy!

Also, Randy: your courses have been a real blessing in my goal of changing careers. Please keep up the good work!

Chase Lee
Chase Lee
29,275 Points

Randy Hoyt, just a quick question. Why are you a moderator now? Do you no longer work for Treehouse or something?

Randy Hoyt
Randy Hoyt
Treehouse Guest Teacher

That's correct. I'm no longer an employee at Treehouse, but I'm still helping out here in the forums when I can!