Guest User

Untitled

a guest
Jul 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. <?php
  2. class MyClass
  3. {
  4.     public $a = 10;
  5.     public $b = 20;
  6.  
  7.     public function __construct($a, $b)
  8.     {
  9.         $this->a = $a;
  10.         $this->b = $b;
  11.     }
  12.  
  13.     public function sayHello()
  14.     {
  15.         echo "Ciao {$this->a} {$this->b}.";
  16.     }
  17. }
  18.  
  19. $myClass = new MyClass('Jacopo', 'Mucci');
  20. $myClass->sayHello();
  21. ?>
Add Comment
Please, Sign In to add comment