类型约束-- 传递类参数到方法里

test()方法的参数 $a 前 加了 A,说明 $a必须是A类的一个实例,所以调用的时候如最后一行。

原文地址:https://www.cnblogs.com/xie-xiao-chao/p/7892452.html