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

Objects in PHP Forum

View Course » View Exercise

353 points
Picture
Submitted by
JCIL
over 2 years ago

What's wrong? I did everything correctly.

<!DOCTYPE html>

Reconstructing the Person
Class



<!-- Your code here -->
<?php
class Person() {
public $isAlive = true;
public $firstName;
public $lastName;
public $age;
}

    $teacher = new Person();
    $student = new Person();
    echo $teacher ->isAlive;
    ?>
  </p>
</body> </html>

1 vote

Best answer

permalink

Nevermind, i figured it out. I had to replace the capital "N" in "firstName" with a lowercase one.

353 points
Picture
Submitted by
JCIL
over 2 years ago