【发布时间】:2011-04-19 21:34:47
【问题描述】:
有没有办法为一个方法添加多个类型提示?例如,foo(param) 必须接收字符串 OR bar OR baz 的实例。
【问题讨论】:
-
类型提示不支持字符串标量;只是指出这一点。
-
@Qix 我们现在应该提到PHP does support scalar type hinting as of PHP 7.0.0。
标签: php type-hinting