Locally installed Ecshop website upload this error Strict standards:only variables should be passed by reference in lib_main.php on line 2661 local PHP is 5 .2 of
The 2661 lines of this file are $ext = end (Explode ('. ', $tmp));
$tmp = basename ($tmp, ". $ext"); What may be the reason for asking for advice
Reply to discussion (solution)
Strict standards:only variables should be passed by reference
Strict criteria: This can only be a variable
$ext = End (Explode ('. ', $tmp));
Should write
$t = $ext = Explode ('. ', $tmp);
$ext = End ($t);
This is a bug check after PHP 5.4.
In fact, PHP has already provided a more concise function
$ext = PathInfo ($tmp, pathinfo_extension);
The parameter required by end is a reference type, and the reference type must be an lvalue, as follows
Mixed End (array & $array)
The function explode returns the right value, which is not a reference.
Mixed End (array & $array)
The argument in end is a reference type.
The explode returned is not a variable, so an error occurred.
In fact, a change can be.
$ext = substr ($tmp, Strrpos ($tmp, '. ') +1);
Or
$ext = Explode ('. ', $tmp); $ext = Array_pop ($ext); Echo $ext;
Again, this is just the error-checking level.
Not the End function cannot accept the return value of a function
Echo phpversion (), Php_eol; Print out PHP with this number $tmp = ' aaa.ext '; $ext = @end (Explode ('. ', $tmp)); Block out error messages echo $ext; Output ext
Thank you for your enthusiastic reply.