当一个变量只能通过引用传递的时候。

如:

$tmplCacheFile = $this->tmplVarReplace(file_get_contents($tmplCacheFile));

Strict Standards: Only variables should be passed by reference in /data/opt/mobile_system/lib/cortrol.class.php on line 353

报错说引用类型不能这样传递。原因是引用类型是用返回值的。所以的用一个变量去接受那个值,在赋值给函数。

$vcontents = file_get_contents($tmplCacheFile);

$tmplCacheFile = $this->tmplVarReplace($vcontents);






原文地址:https://www.cnblogs.com/hgj123/p/4513716.html