пишет синтаксическую ошибку
Цитата |
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in Z:\home\class.ru\www\index.php on line 52 |
class User {
public $name;
public $login;
public $password;
function __construct( $name , $login , $password) {
$this->name = $name;
$this->login = $login;
$this->password = $password;
}
public function showInfo() {
echo '<p>';
echo $this->name.'<br>';
echo $this->login.'<br>';
echo $this->password.'<br>';
echo '</p>';
}
public function __clone() {
$this->name ='Гость';
$this->login ='Гость';
$this->password ='Гость';
}
}
class SuperUser extends User {
public $role;
function __construct( $name , $login , $password, $role) {
$this->name = $name;
$this->login = $login;
$this->password = $password;
$this->role = $role;
function showInfo() {
echo '<p>';
echo $this->name.'<br>';
echo $this->login.'<br>';
echo $this->password.'<br>';
echo $this->role.'<br>';
echo '</p>';
}
}
$user1 = New User('Ангелина','angel','angelpass');
$user1->showInfo();
$user2 = New User('Михаил','mmsgold','mmsgoldpass');
$user2->showInfo();
$user3 = New User('Мария','mary','marypass');
$user3->showInfo();
$user4 = clone $user3;
$user4->showInfo();
$SUser = New SuperUser('mmsgold','login','password','admin');
$SUser->showInfo();
$user1 = New User('Ангелина','angel','angelpass');