MrPotatoes wrote:
i'll return 0 if there is no user found
i'll return 0 if you couldn't be logged in
i'll return 1 if it worked
i'll return -1 if you are already logged in
also, i use -1 for errors where things shouldn't happen.
Firstly, no one here is ganging up on you, this a discussion. If everyone agreed always there would be no need for this forum.
Secondly, this is constructive critisism. We are simply saying some shortfalls of your method. For instance, I sure would like to know the difference between having your user already logged in and errors where things shouldn't happen (lets say for error logging purposes). This sure makes hard for debugging. Also, what if someone who picks up your code and runs the function and the function simply returns false.. not very helpful.
sure, i could be a little more descriptive with the two zeros but guess what, i know how to read code and i don't need an exception. also, i don't need PHP to hold my hand for everything. sorry, i don't care for exceptions in PHP. C# and C++ sure, but not PHP
What's wrong with using exceptions in php?

Even if you have beef with exceptions for whatever reason (I can think of only one), there are alternatives to displaying for helpful error messages. In this case, "also, i use -1 for errors where things shouldn't happen.", wouldn't a fatal error be more appropriate?
I am certainly welcoming any counter points, although I don't think "I don't care for exceptions in php" quite a valid argument in this case. Not that you have to listen to me, nor do you have to reply, but if your going to make certain points and when questioned it is curtious to justify your advise.