For some reason this code doesn't print what it's supposed to yet Codecademy seems to think it's fine. I'm getting the error message "Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE on line 22".
public $numLegs = 4;
public function __construct($name)
$this->name = $name;
public function bark()
return "Hello! My name is " . $this->name . "!";
$dog1 = new Dog("Barker");
$dog2 = new Dog("Amigo");