Advertisement
touhid_xml

construct_destruct method

Nov 2nd, 2012
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?php
  2. class abc{
  3.     function _construct()
  4.     {
  5.         print "I am in abc<br />";
  6. }
  7. }
  8.  
  9. class def extends abc{
  10.    
  11.     function _construct()
  12.     {
  13.        
  14.        parent::_construct();
  15.        print "I am in def<br />";
  16.     }
  17. }
  18. $obj = new abc();
  19. $obj= new def();
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement