在 IBM 网站的文章《开始了解PHP V5中的对象》文中的《关键字:在此我们是否可以有一点隐私?》一节中提到了 logQuey() 函数,但并没有详细解释。这倒是什么一种函数?有何作用?谁能详细的说说!

解决方案 »

  1.   

    清单 8. get() 方法为 Dictionary 类的用户提供了接口
    function get( $term ) {
        $value = $this->translations[$term];
        $this->logQuery( $term, $value, "get" );
        return $value;
    }
    private function logQuery( $term, $value, $kind ) {
        // write log information
    }只是Dictionary类的一个私有函数吧,具体代码文中省略了,只注释了其执行的功能:write log information,记录日志信息。