Fatal error: Using $this when not in object context on line 26 error


exercise- Putting It All Together, Part I

my code-

<!DOCTYPE html>
	  <title> Practice makes perfect! </title>
      <link type='text/css' rel='stylesheet' href='style.css'/>
       class Dog
            public $numLegs=4;
            public $name;
            public function __construct($name){
            public function bark()
                return "hello". $name;
            public function greet()
                return "greet";
        echo $this->name;


You didnt create a object from the class dog.

$dog1 = new dog("Barker");

After that you can echo that:

echo $dog1->bark();

Result should be "hello Barker"