When returning values in php, is it considered good or bad practice to return mixed data types. I\'m working on a project where I am constantly faced with methods that return a
I agree with the answers above.
However if you design a whole system, the "best practice" would be to use exceptions: always return something meaningful, and in case of anomaly, throw an exception. The caller can then deal with the situations he knows how to face, and let somebody higher catch the rest.