int function that needs to be able to return 0, what should it return on error?

Sorry for the long subject, but basically that's my question.

I have a function that returns an int, and one of the possibilities it can return is 0. Sometimes the function needs to return an error/not found message though, so what can it return?

In PHP at least, I know you can have functions return mixed variable types, so in this case it would return an int on success or "false" on fail. Is there a standard way of dealing with this case if all the function can return is an int?

edit: I have it currently returning -1 on error right now and I can deal with that, but I'm just asking to see if there's a "standard" way of dealing with this.

perhaps You could return -1 on error
Then check for it as

I'm just asking to see if there's a "standard" way of dealing with this.

If there is anything resembling a standard, that is it. That's the way things like Serial.read() work.

The best way is to have the function return JUST an error condition, and return the desired value(s) through reference variables.