It's just a matter of fault-tolerant code or not. And returning a negative int is even possible.
And having an object as code could be possible as well. Do you know every php extension by heart? I would not bet my life that there is no extension out there that now or in the future creates an object as code with extended info which is even permitted by php.