开发者

PHP code causing "deprecated" error in PHP 5.3

The following code causes a 'deprecated' error in PHP 5.3... Is there a substitute for it?

$this->widgets[$widget_class] = 开发者_运维知识库& new $widget_class();


It'd be nice if you could specify what exactly the error message says, but I'm guessing it's informing you that object assignment by reference (=&) is deprecated. Objects are always assigned and passed by reference as of PHP 5, so including & is unnecessary. Simply drop the reference operator:

$this->widgets[$widget_class] = new $widget_class();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜