Home  >  Article  >  php教程  >  __lose魔术函数

__lose魔术函数

PHP中文网
PHP中文网Original
2016-05-26 08:20:39992browse

__lose魔术函数

<?php

class logger{


//声明静态类
private $static_class;

//声明类中过程方法(不需要返回值的方法)
const LOSE=false;

//本类中的info、trace方法失效
function __lose(){
return array(&#39;info&#39;,&#39;trace&#39;);
}

static function info($data=&#39;ok&#39;,$file_name=&#39;&#39;){
//return false; //__lose的作用
empty($file_name) and $file_name=date(&#39;Y_m_d&#39;).&#39;log&#39;;
file_put_contents($file_name,$data);
}

static function trace($data=&#39;ok&#39;,$file_name=&#39;&#39;){
//return false; //__lose的作用
empty($file_name) and $file_name=date(&#39;Y_m_d&#39;).&#39;log&#39;;
file_put_contents($file_name,$data);
}

static function error($data=&#39;error&#39;,$file_name=&#39;&#39;){
empty($file_name) and $file_name=date(&#39;Y_m_d&#39;).&#39;log&#39;;
file_put_contents($file_name,$data);
}


}

                   

 以上就是__lose魔术函数的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn