Vidyalelo
PHP · Q58

Object Oriented Concept

Programming · PHP · question 58

Q58

PHP recognizes constructors by the name_________

A.
classname()
B.
_construct()
C.
function _construct()
D.
function __construct()
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
A double underscore followed by the construct keyword. Its syntax is function __construct ([ argument1, argument2,…..]) { Class Initialization code }.