It says theres an error on line 21 ?!


#1









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

    echo $teacher->isAlive;

    public function __construct($firstname,$lastname,$age) {
        $this->firstname = $firstname;
        $this->lastname = $lastname;
        $this->age = $age;   
    }
    $teacher = new Person("boring","12345",12345);
    $student = new Person("Jett","Callard",15);

    echo $student->age);

    public function greet() {
        return "Hello, my name is " . $this->firstname . " " . $this->lastname ". nice to meet you";
    }
    greet();
    ?>
  </p>
</body>


#2

this line
public function __construct($firstname,$lastname,$age) {


#3

remove these two lines

these

Have to moves into the Person Class. ie before the } after public $age

you can only call it using the two instances you created

an you can use this

after creating $teacher