Q. What is the result of the following PHP code?
Code:
<?php
class Person
{
public $name = "Person";
public function __construct($name)
{
$this->name = $name;
}
}
$p = new Person("John");
echo $p->name;
?>
β
Correct Answer: (B)
John