Magic Property¶
Special properties, which are not declared, but dynamically handled by the magic methods. They do not have specific declaration.
The magic methods to handle magic properties are : __get(), __set(), __isset() and __unset().
<?php
class x {
//
function __get($name) {
return 'World!';
}
}
$x = new x;
echo $x->hello; // display World!
?>
Related : __get() Method, __set() Method, Magic Constants