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

Need help with objects quiz in php

Here's the link (5/7):

http://teamtreehouse.com/library/programming/build-a-simple-php-application/wrapping-up-the-project/objects

<?php

    include("class.palprimechecker.php");

    $checker = new PalPrimeChecker();

    $checker->number = 17;

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

?>

May I ask what I'm doing wrong?

2 Answers

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Very close. It looks you like you are using syntax from another programming language. :~) In many programming languages, a dot (.) is used after an object name to identify a method or a property inside that object. PHP uses the two characters that together look like a single arrow (->) instead.

Where you have this --

$checker.isPalprime()

-- you should have this --

$checker->isPalprime()

Does that help?

Ah, thanks alot :smile: