【发布时间】:2015-01-27 02:01:05
【问题描述】:
是否可以将类函数中参数的默认值设置为静态变量 感谢您提前提供的帮助!
class UserControl {
public static $CurrentUID;
public static function isUserExist($CurrentUID = UserControl::$CurrentUID){
....
}
}
【问题讨论】:
-
不可能,如PHP documentation,
The default value must be a constant expression, not (for example) a variable, a class member or a function call.中所说 -
啊……当然只做字符串
标签: php static arguments default default-value