Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. class Parent{
  2. protected $test='parent';
  3. public function getTest(){
  4. return $this->test;
  5. }
  6. }
  7.  
  8. class Child{
  9. public function __construct(){
  10. $this->test = 'child';
  11. }
  12. }
  13.  
  14. $parent = new Parent();
  15. var_dump($parent->getTest());
  16. $child = new Child();
  17. var_dump($child->getTest());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement