what is constructor in a class, how it is work, how it is call?

Answer Posted / sei thu htun

Constructors are functions in a class that are automatically
called when you create a new instance of a class with new. A
function becomes a constructor, when it has the same name as
the class. If a class has no constructor, the constructor of
the base class is being called, if it exists.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between mysql_connect and mysqli_connect?

691


What is csrf token and why it is required?

719


Is php object oriented?

685


Explain about getters and setters in php?

739


Why php is widely used?

699


How to create a table to store files?

734


What is php resource type?

710


What is framework in php?

732


What is mysql_fetch_row?

760


Is it possible to use com component in php?

730


How to include a file code in different files in php?

754


Describe PHP error and logging information?

760


How to Retrieve the Session ID of the Current Session?

722


What is x+ mode in fopen() used for?

746


What is a model in php?

806