Organizational Research By

Surprising Reserch Topic

How do you call a constructor for a parent class using php ?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
26 views



Related Hot Questions

1 Answer

0 votes
How do you call a constructor for a parent class? 



parent::constructor($value) 


Example:



class parentClass
{
     function __construct()
   {
    }
}


class chClass extends parentClass
{
   function __construct()
   {
      parent::__construct(); //call a constructor for a parent class
       }
}

answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...