Home > php教程 > PHP源码 > body text

__lose魔术函数

PHP中文网
Release: 2016-05-26 08:20:39
Original
990 people have browsed it

__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);
}


}
Copy after login

                   

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template