If after PHP upgrade you're getting error "PHP Fatal error: Cannot declare class error, because the name is already in use ...", you will have to rename your "error" class.
Since PHP 7 classname "Error" is predefined and used internally.
Error is the base class for all internal PHP errors.
The error message
The error code
The filename where the error happened
The line where the error happened