PHP - Classes and Objects
What will be the output of the following PHP code?
class Dog {
public $name;
public function __construct($name) {
$this->name = $name;
}
public function bark() {
return "Woof! I am " . $this->name;
}
}
$dog = new Dog("Buddy");
echo $dog->bark();
