[英]Implements a abstract method with interface type hint with a concrete typing class
[英]type hint a object that implements interface not the class
在PHP 5.3>我可以输入提示带接口的对象吗?
像这样:
public function AddToFavorite(Trendmed\Interfaces\Favoriteable $entity) {}
或者我只限于检查函数内部的实现? 我试着像上面那样键入提示,但它不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.