Php prompts Call-time pass-by-reference has been deprecated error

Source: Internet
Author: User
Tags deprecated function definition ini

The error message is as follows:

Warning: Call-time pass-by-reference has been deprecated in E: Website Directory www Directory a. php on line 46

Warning: Call-time pass-by-reference has been deprecated in E: www Directory a. php on line 47

Warning: Call-time pass-by-reference has been deprecated in E: www Directory a. php on line 47

Warning: Call-time pass-by-reference has been deprecated in E: Website Directory www Directory a. php on line 48

Warning: Call-time pass-by-reference has been deprecated in E: Website Directory www Directory a. php on line 49

Warning: Call-time pass-by-reference has been deprecated in E: Website Directory www Directory a. php on line 51

Warning: Call-time pass-by-reference has been deprecated in E: Website Directory www Directory a. php on line 56

Warning: Call-time pass-by-reference has been deprecated in E: Website Directory www Directory a. php on line 56

The solution is as follows:


Method 1:

Change display_errors = on of php. ini to display_errors = off // (no error is displayed)
It is not displayed.
However, this method is not very good, but does not display errors. In fact, errors still exist.

Method 2:

1. Search for the keyword allow_call_time_pass_reference in PHP. ini and create it by yourself.
2. Change Off to On, and the Web Server will be OK when it is restarted ~
Allow_call_time_pass_reference = Off to allow_call_time_pass_reference = On

By the way, the meaning of the allow_call_time_pass_reference parameter is explained:
Whether to enable the force parameter to be passed by reference when the function is called. This method is no longer supported in PHP/Zend versions. We recommend that you specify which parameters should be passed by reference in the function definition. We encourage you to disable this option and ensure that the script runs properly to ensure that the script can run in future versions. (each time you use this feature, you will receive a warning, parameters are passed by value rather than by reference ).

It is not recommended to pass parameters by reference during function calling because it affects code cleanliness. If the parameter of a function is not declared as a reference, the function can modify its parameter without writing the document. To avoid its side effects, it is best to specify the parameter only when the function declaration needs to be passed through reference.

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.