php class User public name public login public password public functio

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
class User{
public $name;
public $login;
public $password;
public function showInfo(){
echo $this->name.' '.$this->login.' '.$this->password.'<br>';
}
}
$user1 = new User();
$user1->name = 'Admin';
$user1->login = 'admin';
$user1->password = '12345';
$user2 = new User();
$user2->name = 'Vasya';
$user2->login = 'vasya';
$user2->password = 'qwerty';
$user3 = new User();
$user3->name = 'Petya';
$user3->login = 'petya';
$user3->password = '123';
$user1->showInfo();
$user2->showInfo();
$user3->showInfo();
?>