1.

PHP recognizes constructors by the name _________(a) classname()(b) _construct()(c) function _construct()(d) function __construct()This question was addressed to me in my homework.This is a very interesting question from Basics of Object-Oriented PHP- 2 topic in section Object-Oriented PHP of PHP

Answer»

The correct OPTION is (d) function __construct()

Best explanation: A DOUBLE underscore FOLLOWED by the CONSTRUCT keyword. Its syntax is function __construct ([ argument1, argument2,…..]) { Class Initialization code }.



Discussion

No Comment Found

Related InterviewSolutions