Advertisement
Gleidson_21

Metodos e atributos estaticos

Jul 30th, 2021
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. class Logins {
  4.     public static $user;
  5.  
  6.     public static function verificaLogin(){
  7.         echo "O usuário ".self::$user." está logado";
  8.     }
  9.  
  10.     public function sairSistema(){
  11.         echo "O usuário deslogou";
  12.     }
  13. }
  14.  
  15. Logins::$user = "admin";
  16. Logins::verificaLogin();
  17. echo "<br>";
  18. $login = new Logins();
  19. $login->sairSistema();
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement