Stratician

Practice with OOP

Jan 29th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. class News {
  2.  
  3.     public $title;
  4.  
  5.     public $description;
  6.  
  7.     public function __construct($title, $description)
  8.     {
  9.         $this->title = $title;
  10.         $this->description = $description;
  11.     }
  12.  
  13. }
  14.  
  15. $newNews = new News("New Justice League Series", "Justice League is coming back to Cartoon Network with Mark Hamill and Kevin Conroy");
  16.  
  17. var_dump($newNews->title);
  18.  
  19. var_dump($newNews->description);
Advertisement
Add Comment
Please, Sign In to add comment