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
A function that returns mixed values is not considered bad., in fact thats the beauty of php, it being a dynamic language., so the thing to do is return false on failure and the required value if the function executes correctly,.
if( false == ( $data = do_something() ) ) return false;
else print_r( $data );