PHP OOP : Constructor function

What is Constructor ?

Constructor is a special type of function of a class which is automatically executed when object of that class is created. Constructor is also called as magic function because in php constructor is start usually with two underscore characters. It saves lot of time on big project.

function __constructor(){
body part;
}

Example of Constructor :-

Latest posts by vikashdev k (see all)
Tagged : / / / / / / / / / / / /
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x