class A{ function __toString() { return "怎么使用echo输出对象"; } } $arr=new A(); echo $arr; 转载于:https://www.cnblogs.com/djj123/p/11045724.html