Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong><a href="http://www.php.net/manual/en/language.oop5.magic.php" rel="nofollow noreferrer">Magic Methods</a></strong> are fall-through methods that get called whenever you invoke a method that doesn't exist or assign or read a property that doesn't exist, among other things.</p> <pre><code>interface AllMagicMethods { // accessing undefined or invisible (e.g. private) properties public function __get($fieldName); public function __set($fieldName, $value); public function __isset($fieldName); public function __unset($fieldName); // calling undefined or invisible (e.g. private) methods public function __call($funcName, $args); public static function __callStatic($funcName, $args); // as of PHP 5.3 // on serialize() / unserialize() public function __sleep(); public function __wakeup(); // conversion to string (e.g. with (string) $obj, echo $obj, strlen($obj), ...) public function __toString(); // calling the object like a function (e.g. $obj($arg, $arg2)) public function __invoke($arguments, $...); // called on var_export() public static function __set_state($array); } </code></pre> <p>A C++ developer here might notice, that PHP allows overloading some operators, e.g. <code>()</code> or <code>(string)</code>. Actually PHP allows overloading even more, for example the <code>[]</code> operator (<a href="http://www.php.net/manual/en/class.arrayaccess.php" rel="nofollow noreferrer">ArrayAccess</a>), the <code>foreach</code> language construct (<a href="http://www.php.net/manual/en/class.iterator.php" rel="nofollow noreferrer">Iterator</a> and <a href="http://www.php.net/manual/en/class.iteratoraggregate.php" rel="nofollow noreferrer">IteratorAggregate</a>) and the <code>count</code> function (<a href="http://www.php.net/manual/en/class.countable.php" rel="nofollow noreferrer">Countable</a>).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload