Why does this work? Why does this show the email address?
#1
Code:
<?php
class person {
private $email = ?foo?;
function showEmail() {
echo $this->email;
}
}
class user extends person {}
$u = new user();
$u->showEmail();
but this doesn?t?
#2
Code:
<?php
class person {
private $email = ?foo?;
}
class user extends person {
function showEmail() {
echo $this->email;
}
}
$u = new user();
$u->showEmail();
Also, why does this work
#3
Code:
<?php
class person {
private $email = ?foo?;
function showEmail() {
echo $this->email;
}}
class user extends person {
function showEmail() {
parent::showEmail();
}
}
$u = new user();
$u->showEmail();



