What are magic methods?

Magic methods are special names, starts with two underscores, which denote methods which will be triggered in response to particular PHP events.

The magic methods available in PHP are given below:-

  • __construct()
  • __destruct()
  • __call()
  • __get()
  • __set()
  • __isset()
  • __unset()
  • __sleep()
  • __clone()
  • __autoload() etc

Suggest An Answer

No suggestions avaliable!

Latest post from oops interview questions

Ask Question