tostring方法

//__tostring()方法
//输出内容时不报错

用法实例:
class Ren
{
public $name;
public function __tostring()
{
return "该类是人类,name代表姓名";
}
}
$r = new Ren();

posted @ 2017-04-20 15:58  陈山河z  阅读(107)  评论(0编辑  收藏  举报