Is this exactly the code that gives you the error ? I'm asking because you would normally get that error if you try to assign the unset to a variable.
Well not exactly the same, my class is much bigger, but the structure and line where unset is used is almost the same. I really do not understand why this is happening and now a workaround must be found....