Fatal error: Call-time pass-by-reference has be…

After chopping hands, the fraud call came before the express delivery was received. How to improve the privacy and security of e-commerce>>>

allow_ call_ time_ pass_ reference boolean

Whether to issue a warning when a parameter is passed by reference during a function call. This method is no longer approved and is likely not supported in future versions of PHP/Zend. One way to encourage this is to specify in the function definition which parameters should be passed by reference. You are encouraged to try to turn off this option and make sure that the script runs properly to ensure that it will also run in future versions (you will receive a warning every time you use this feature)

It is not recommended to pass parameters by reference when a function is called because it affects the neatness of the code. If the parameters of a function are not declared and passed as references, the function can modify its parameters without writing to the document. To avoid its side effects, it is best to specify only which parameter needs to be passed by reference when the function is declared

See explanation of citation

Changelog for allow_ call_ time_ pass_ Reference Version Description
5.4.0 is removed from PHP
5.3.0 Emits an E_ DEPRECATED level error.
5.0.0 Deprecated, and generates an E_ COMPILE_ WARNING level error.

***********************************************************************************

This error may occur when PHP is upgraded to version 5.4

If functions (or classes) are used in this way, a PHP fatal error will be generated:
foo & amp$ var);
in fact, this usage will be prompted in php5.3, but the previous usage will only prompt degraded

[html] view plaincopy

//write it correctly
function myfunc & amp$ arg) { do something… }

myFunc($var);// Call myfunc

// error
function myfunc ($ARG) {do something…}

myfunc & amp$ arg);// Call myFunc

***********************************************************************************

It means that the reference parameter has been removed when calling, that is, it cannot be passed through function (& amp$ a) This method calls the function by passing parameters

Solution:

Look at your php.ini configuration file and add allow to it_ call_ time_ pass_ Adjust the reference parameter to true and try restarting the server

In addition, this error may occur when the previous PHP code is upgraded to PHP version 5.4

When we use a function (or class) in this way, we get an error:

foo(&$ var);

In fact, this is wrong, but the previous error level is only degraded

The correct way to use it is to define the function:

function foo(& $ var) {
//other code
}

When calling, you can pass parameters directly: foo ($var)

Similar Posts: