Jnr PHP/Codeigniter Developer Question:

Download Job Interview Questions and Answers PDF

Tell us what are the __construct() and __destruct() methods in a PHP class?

Jnr PHP/Codeigniter Developer Interview Question
Jnr PHP/Codeigniter Developer Interview Question

Answer:

All objects in PHP have Constructor and Destructor methods built-in. The Constructor method is called immediately after a new instance of the class is being created, and it’s used to initialize class properties. The Destructor method takes no parameters.

Understanding these two in PHP means that the candidate knows the very basics of OOP in PHP.

Download Jnr PHP/Codeigniter Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me the different types of errors in PHP?Tell me how you can extend the class in Codeigniter?