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

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

posted @ 2017-11-24 21:40  xc_flying  阅读(114)  评论(0编辑  收藏  举报