The indicated error is due to one of the incompatibilities of versions 5.3 and 5.4, you can see a list here , specifically the incompatibility is:
The step by reference in call time has been eliminated.
In the documentation of step by reference we found a note that does not indicate the following:
Note: There is no reference sign in a call to a function - only in the definition of the function. The definitions of functions alone are sufficient to correctly pass the argument by reference. As of PHP 5.3.0, you will get a warning saying that "call-time pass-by-reference" (pass by reference in call time) is obsolete when you use & in foo (& $ a); As of PHP 5.4.0, the step by reference call time has been eliminated, so its use will emit a fatal error.
Summing up this means that the calls to functions passing variable as reference is obsolete, in PHP 5.3 a warning was issued and in 5.4 a fatal error. Example:
<?php
function foo(&$var)
{
$var++;
}
$var = 1;
foo(&$var); // ERROR
foo($var); // Correcto
Also in the documentation we can see that you can only pass the following by reference:
- Variables, that is, foo ($ a)
- New statements, that is, foo (new foobar ())
- References returned from functions
If only this is the error you have had when migrating from PHP 5.3.x to PHP 5.4.x, my recommendation is that you correct the code by removing the references, that is, by removing the & amp; (ampersand or et) before the variables in the functions.