• 技术文章 >php教程 >php手册

    php错误提示:Call-time pass-by-reference has been deprecated

    2016-06-13 09:57:08原创1421

    今天在写引用时突然出现了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);

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    上一篇:php数组提示Notice: Undefined offset解决办法 下一篇:自己动手写 PHP MVC 框架(40节精讲/巨细/新人进阶必看)

    相关文章推荐

    • 日常整理PHP中简单的图形处理(经典)• PHP5中Cookie与 Session使用详解• 从一个不错的留言本弄的mysql数据库操作类• 15种PHP Encoder的比较• PHP断点续传-HTTP
    1/1

    PHP中文网