php错误提示:Call-time pass-by-reference has been deprecated
发布:smiling 来源: PHP粉丝网 添加日期:2013-12-04 21:12:59 浏览: 评论:0
今天在写引用时突然出现了Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of getimagesize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer错误,后来才知道原因是此方法已不被赞成并在 PHP/Zend 未来的版本中很可能不再支持了
解决办法
第一种方法、 把php.ini的display_errors = on改成display_errors = off (不显示错误)
第二种方法、allow_call_time_pass_reference = Off 变成 allow_call_time_pass_reference = On
上面是对php.ini进行修改,但是如果你没有权限可以修改程序,下面我举个简单的例子,可能出现问题的代码如下:
- function test1($a,$b){
- $b = "fun_test1";
- return;
- }
- $a = "a_value";
- $b = "b_value";
- test1($a,&$b);
不会有问题出现代码如下:
- function test2($a,&$b){
- $b = "fun_test2";
- return;
- }
- $a = "a_value";
- $b = "b_value";
- test2($a,$b);
Tags: 错误提示 Call-time pass-by-reference
相关文章
- ·Notice:undefined index ..错误提示解决方法(2013-12-02)
- ·linux中phpMyAdmin错误提示Wrong permissions on configuration file, should no(2013-12-02)
- ·PHP关闭Notice错误提示(2014-01-03)
- ·php 关闭错误提示方法总结与性能分析(2014-01-03)
- ·php开启与关闭错误提示(2014-02-18)
- ·php错误提示 open_basedir restriction in effect 解决(2014-09-20)
- ·浅谈php错误提示及查错方法(2021-06-12)
- ·关于php开启错误提示的总结(2021-12-22)
- ·php提示Call-time pass-by-reference has been deprecated错误(2014-09-21)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)