I found this out:
The error you’ve provided only occurs on PHP 8 and it is because you’re trying to add a string to an integer. In previous versions the error message used to be “A non-numeric value encountered” which in some situations made the issue a lot clearer.
In PHP v5.6 you would receive no error at all (and the code would work fine)
In PHP v7 you would be informed with a WARNING that “A non-numerical value was encountered”
In PHP v8 you are informed with a FATAL error that “Uncaught TypeError: Unsupported operand types: string + int”