close

// Autoloading Objects

function __autoload($class_name) {

        require_once $class_name . '.php';

}

 

class MyClass {

        // Defining an object constructor

        function __construct() {}

       

        // Defining an object destructor

        function __destruct() {}

 

        // Defining a class's stringification      

        function __toString() {}

 

        // It is triggered when invoking inaccessible methods

        // in an object context.

        function __call($name, $arguments) {}

 

        // An object copy is created by using the clone keyword

   // (which calls the object's __clone() method if possible)

        function __clone() {}

 

        // It is utilized for reading data from inaccessible members.

        function __get($property) {}

 

        // It is run when writing data to inaccessible members.

        function __set($property, $value) {}

 

        // called when object is serialized

        function __sleep() {}

 

        // called when object is unserialized

        function __wakeUp() {}

}

 

詳細內容:http://www.php.net/manual/en/language.oop5.magic.php

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 coolouis 的頭像
    coolouis

    村天來了

    coolouis 發表在 痞客邦 留言(0) 人氣()