Advertisement
Sunny_Capt

php class example

Oct 31st, 2019
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. <?php
  2. // сделать класс на php
  3. class User{
  4.     private $userName;
  5.     private $age;
  6.  
  7.     function __constuctor($userName, $age){
  8.         $this->userName = $userName;
  9.         $this->age = $age;
  10.     }
  11.  
  12.     function whois(){
  13.         return 'Name: ' . $this->userName . '\nAge: ' . $this->age;
  14.     }
  15. }
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement