Php error message: Call-timepass-by-referencehasbeendeprecated

Source: Internet
Author: User
Today, when writing a reference, the following error occurs: Warning: Call-timepass-by-referencehasbeendeprecated-argumentpassedbyvalue; Ifyouw.

Today, when writing a reference, the following error occurs: Warning: Call-time pass-by-reference has been deprecated-argument passed by value; If you wocould like to pass it by reference, modify the declaration of getimagesize (). if you wowould 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 error. later I learned that this method was no longer supported and may not be supported in future PHP/Zend versions.

Solution

First, change display_errors = on of php. ini to display_errors = off (no error is displayed)

Method 2: convert allow_call_time_pass_reference = Off to allow_call_time_pass_reference = On

The above is to modify php. ini, but if you do not have the permission to modify the program, the following is a simple example. the code that may cause problems is as follows:

  1. Function test1 ($ a, $ B ){
  2. $ B = "fun_test1 ";
  3. Return;
  4. }
  5. $ A = "a_value ";
  6. $ B = "B _value ";
  7. Test1 ($ a, & $ B );

The code is as follows:

  1. Function test2 ($ a, & $ B ){
  2. $ B = "fun_test2 ";
  3. Return;
  4. }
  5. $ A = "a_value ";
  6. $ B = "B _value ";
  7. Test2 ($ a, $ B );

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.