Magic Methods¶
Special methods, which provide extended support for PHP features.
The magic methods are : __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __clone() and __debugInfo().
The constructor and destructors are not considered as magic methods, even though they are reserved.
<?php
class x {
//
function __get($name) {
return $this->$name;
}
}
?>
See also What are magic methods in PHP? and How to Implement them?, PHP Magic Methods Explained
Related : __get() method, __set() method, __call() Method, __isset() method, __clone() method, __callStatic() method, __isset() method, __sleep() method, __wakeup() method, __toString() Method, __invoke() method, __set_state() method