OOPS Magic Methods

Magic Methods The function names __construct, __destruct (see Constructors and Destructors), __call, __get, __set, __isset, __unset (see Overloading), __sleep, __wakeup, __toString, __set_state, __clone and __autoloadare magical in PHP classes. You cannot have functions with these names in any of your classes unless you want the magic functionality associated with them. __sleep and __wakeup serialize() checks if your class has a function with the magic name __sleep. If so, that function is executed prior to any serialization. It can clean up the object and is supposed to return an array with…

Read More