Issue: Only variables should be passed by reference

Hey. I find a issue in your code. You cannot write end(explode(... )) because end() requires a reference. It modifies the internal representation of the array. See: http://php.net/manual/en/function.end.php