Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class User{
- private $id;
- private $username;
- private $email;
- private $password;
- public function __construct($username, $password){
- $this->username = $username;
- $this->password = $password;
- }
- public function __destruct()
- {
- // TODO: Implement __destruct() method.
- echo 'Destructor is called<br>';
- }
- public function register(){
- echo 'User is registered<br>';
- }
- public function login(){
- $this->auth_user();
- }
- public function auth_user(){
- echo $this->username.' is authenticated<br>';
- }
- }
- $user = new User('Rony', '1234');
- $user->register();
- $user->login();
Add Comment
Please, Sign In to add comment