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!
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

Unsubscribed User
8,167 PointsStuck on PHP Objects Challenge
First, assign that property a value of 17. Second, remove the two hash signs (##) in the first echo statement and instead concatenate the value of this number property.
Stuck on this assignment. Challenge 4 of 7
Anyone under this assignment??
include ('class.palprimechecker.php');
$checker = new palprimechecker();
echo "The number ##";
echo "(is|is not)";
echo " a palprime.";
?>
6 Answers

Unsubscribed User
8,167 Pointsfor the second part...i thought the answer was echo "The number " . $checker;
was correct but I cannot figure out the first part so I am unsure of the second as well.

Mike Costa
Courses Plus Student 26,362 PointsHey Justin,
In order to access an objects property, you'll need to use the arrow operator.
$checker->number;
Hope this helps.

Unsubscribed User
8,167 PointsStill can't seem to figure it out...
so far i have this
include ('class.palprimechecker.php');
$checker = new palprimechecker(); $checker->number;
echo "The number " . $checker; echo "(is|is not)"; echo " a palprime.";

Unsubscribed User
8,167 PointsSorry this should be easier to read include ('class.palprimechecker.php');
$checker = new palprimechecker();
$checker->number;
echo "The number " . $checker;
echo "(is|is not)";
echo " a palprime.";

Mike Costa
Courses Plus Student 26,362 PointsNow that you have access to that property, you'll need to assign it a value. As an example:
$obj->property = value;

nemanjasreckovic
8,784 Pointsthis will work
<?php
include_once('class.palprimechecker.php');
$checker = new PalprimeChecker();
$checker->number = 12421;
echo "The number ". $checker->number;
if ($checker->isPalprime()) { echo "is"; } else {echo "is not";};
echo " a palprime.";
?>