//__tostring()方法//输出内容时不报错
用法实例:class Ren{ public $name; public function __tostring() { return "该类是人类,name代表姓名"; }} $r = new Ren();