PHP Error Tip: Call-time pass-by-reference has been deprecated_php tutorial

Source: Internet
Author: User
Tags php error
Today when writing a quote suddenly appeared warning:call-time Pass-by-reference has been deprecated-argument passed by value; If you would a to pass it by reference, modify the declaration of GetImageSize (). If you would as to enable Call-time pass-by-reference, you can set Allow_call_time_pass_reference to true in your INI fi Le. However, the future versions might not be the support this any longer error, later only to know the reason is that this method has not been approved and is likely to be no longer supported in the next version of Php/zend

Solutions

The first method, change the php.ini = Display_errors = on to display_errors = Off (no error is displayed)

The second method, allow_call_time_pass_reference = Off becomes allow_call_time_pass_reference = on

The above is to modify the php.ini, but if you do not have permission to modify the program, let me give a simple example

Problems that may occur

The code is as follows Copy Code

function test1 ($a, $b) {

$b = "Fun_test1";

Return

}

$a = "A_value";

$b = "B_value";

Test1 ($a,& $b);

There's no problem.

The code is as follows Copy Code

function test2 ($a,& $b) {

$b = "Fun_test2";

Return

}

$a = "A_value";

$b = "B_value";

Test2 ($a, $b);

http://www.bkjia.com/PHPjc/632128.html www.bkjia.com true http://www.bkjia.com/PHPjc/632128.html techarticle today when writing a quote suddenly appeared warning:call-time Pass-by-reference has been deprecated-argument passed by value; If you would as to pass it by reference, modify the Declar ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.