I am puzzled why it won't display the name. I expect to see the output, "Jeffrey" but it doesn't. I created an object with an argument to be passed to the constructor so I expected "JEFFREY" to be displayed but it didn't. I added the echo function in constructor to see if it output jeffrey and it didn't echo either. PHP didn't show any errors. What is that I am doing wrong?
class person {
public $name;
function __constructor($name)
{
$this->name=strtoupper($name);
echo $name;
}
function displayName()
{
echo "<h1>$this->name</h1>";
}
}
$m = new person("jeffrey");
$m->displayName();