Home  >  Article  >  php教程  >  PHP Fatal error: Call-time pass-by-reference has been remove

PHP Fatal error: Call-time pass-by-reference has been remove

WBOY
WBOYOriginal
2016-06-13 11:31:451259browse

意思是调用时引用传参已经被移除了,就是不能通过function(&$a)这种方式传参调用函数.<br /><br />解决方案:<br /><br />查看你的php.ini配置文件,把其中的 allow_call_time_pass_reference参数调整为true,并重启服务器试试。 <br /><br />======================================<br />此外,以前的php代码在升级到5.4版本的php可能会出现这种错误:<br /><br />当我们这样使用函数(或者类)的话,会产生一个error:<br /><br />foo(&$var);<br /><br />实际上,这样用本来就是错的,只是之前的错误级别仅仅是Deprecated而已。<br /><br />而正确的使用方法应该是在函数定义时:<br /><br />function foo(& $var) {<br />   //other code<br />}<br /><br />而在调用时直接传参就行了: foo($var);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn