1
Reply

In PHP, what are magic methods and how are they used?

saurabh  singh

saurabh singh

Mar 18, 2015
400
0

    PHP functions that start with a double underscore – a “__” – are called magic functions (and/or methods) in PHP. They are functions that are always defined inside classes, and are not stand-alone (outside of classes) functions. The magic functions available in PHP are: __construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __clone(), and __autoload().

    saurabh singh
    March 18, 2015
    0