PHP MAGIC METHODS?

Magic methods are member functions that are available to all the instance of class.
Magic methods always start with “__”. Eg. __construct.

All magic methods need to be declared as public
To use a method, it should be defined within the class or program scope
Various Magic Methods used in PHP 5 are:
__construct()
__destruct()
__set()
__get()
__call()
__toString()
__sleep()
__wakeup()
__isset()
__unset()
__autoload()
__clone().

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s