Explain me what is the procedure to call a constructor for a parent class?
Answer Posted / Nisha Bharti
In PHP, when you want to call a parent class constructor, you can do so by using the keyword 'parent' followed by the constructor name and arguments within the child class constructor. Example: class Child extends Parent { public function __construct($argument) { parent::__construct($argument); // Calls Parent's constructor }
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers