Advertisement
ozh

class construct from parent

ozh
Jan 13th, 2014
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2.  
  3. class blah_blah extends blah {
  4.     function say_foo() {
  5.         echo $this->foo;
  6.     }
  7. }
  8.  
  9. class blah {
  10.     var $foo = '';
  11.    
  12.     function blah( $foo ) {
  13.         $this->foo = $foo;
  14.     }
  15. }
  16.  
  17. $hey = new blah_blah( "omg" );
  18. $hey->say_foo(); // omg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement