Strict Standards: Only variables should be assigned by reference
函数的返回值似乎不能引用
Strict Standards: Only variables should be assigned by reference
函数的返回值似乎不能引用
一般不要使用函数返回引用,详见php官方文档
Do not use return-by-reference to increase performance. The engine will automatically optimize this on its own. Only return references when you have a valid technical reason to do so.
不要企图通过返回引用提高程序性能,引擎会自动进行优化,只有在有明确的里有的情况下才可以使用!
这里之所以报警告,是因为用法错误
Note: Unlike parameter passing, here you have to use & in both places - to indicate that you want to return by reference, not a copy, and to indicate that reference binding, rather than usual assignment, should be done for $myValue.
也就是说必须要同时在函数定义和使用的时候前面都加&
,正如 @咪蛾 所说 。
2 回答1.6k 阅读✓ 已解决
1 回答1.4k 阅读✓ 已解决
2 回答1k 阅读✓ 已解决
2 回答1.1k 阅读
1 回答946 阅读
1 回答899 阅读
1 回答897 阅读
当前php版本不影响功能错误提示,关闭错误提示就可以了,但不保证在将来的版本不失效。
或者修改成这样就不会报错了