解决Fatal error: Call-time pass-by-reference has bee
程序员文章站
2022-04-24 21:01:27
...
今天在使用PHP 5.4.15 版本时遇到这个错误: Fatal error : Call-time pass-by-reference has been removed in /opt/lampstack-5.4.15-0/apps/lixiphp/htdocs/function.inc on line 161 产生这个错误原因是在PHP函数语句中使用来引用变量。比如: foo($varia
今天在使用PHP 5.4.15 版本时遇到这个错误:
Fatal error: Call-time pass-by-reference has been removed in /opt/lampstack-5.4.15-0/apps/lixiphp/htdocs/function.inc on line 161
产生这个错误原因是在PHP函数语句中使用&来引用变量。比如:
foo(&$variable);
实际上,这样用法在PHP 5.3 中就会有提示,只是之前的仅仅会提示Deprecated而已。
简单一句话,调用函数时不需要传递引用变量。
正确用法
函数语句中不需要使用引用变量。
myFunc($var);//Call myFunc function myFunc(&$arg) { do something... }????
错误用法
myFunc(&$arg);//Call myFunc function myFunc($arg) { do something... }?
屏蔽错误显示
error_reporting(0); ini_set('display_errors', 'off');
运行时环境:
(...)
Read the rest of 解决Fatal error: Call-time pass-by-reference has been removed (9 words)
© lixiphp for LixiPHP, 2013. | Permalink | No comment |
Add to del.icio.us
Post tags: PHP 5.4, reference. 引用
Feed enhanced by Better Feed from Ozh
推荐阅读
-
php提示Call-time pass-by-reference has been deprecated in的解决方法[已测]
-
php提示Call-time pass-by-reference has been deprecated in的解决方法[已测]_php实例
-
php提示Call-time pass-by-reference has been deprecated in的解决方法_PHP教程
-
PHP Fatal error: Call-time pass-by-reference has been remove
-
php提示Call-time pass-by-reference has been deprecated in的解决方法
-
php提示Call-time pass-by-reference has been deprecated in的解决方法[已测]_php实例
-
PHP Fatal error: Call-time pass-by-reference has been remove
-
Fatal error: Call-time pass-by-reference has been removed,passbyreference
-
deprecated php提示Call-time pass-by-reference has been deprecated in的解决方法[已测]
-
Fatal error: Call-time pass-by-reference has been removed,passbyreference_PHP教程