This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Objects in PHP Forum

View Course » View Exercise

301 points
Picture
Submitted by
David Garcia
almost 4 years ago

[resolved] 4/10 Did you add the '$firstname', '$lastname' and '$age' properties?

in the exercise of property panic 1, dont letme keep going on, get this error

Oops, try it again. Did you add the '$firstname', '$lastname' and '$age' properties?

but this is my code

<?php
    class Person {
        public $isAlive = true;
        public $firstName;
        public $lastName;
        public $age;
    }
        $teacher = new Person();
        $student = new Person();

        echo $teacher->isAlive;

    ?>

and this is the exercise

Add a public $isAlive property to the Person class and assign the value true to $isAlive.
Add three further public properties to thePerson class: $firstname, $lastname and $age. Don't assign any values to these.
echo the value of the $isAlive property of your $teacher object.

on the hint my code is like that ...but show rthat error ..can help me pls


3 votes

permalink

Hi David, just a small thing to fix:

$firstName
$firstname

3692 points
55df2afa95e3787b9200005e_359368177
Submitted by
Judy
almost 4 years ago

5 Comments

Picture David Garcia almost 4 years ago

excuse me but i dont get it...i have it that way...i dont find any to fix...

Picture David Garcia almost 4 years ago

nvm
i fiind it...;) tks albi

55df2afa95e3787b9200005e_359368177 Judy almost 4 years ago

The N - change it to an n.

5154c6cf115b457ac9000021_667301409 boring12345 almost 4 years ago

Me thinks I should allow both solutions.

55df2afa95e3787b9200005e_359368177 Judy almost 4 years ago

+1