Best guess is that it does not think it is being passed a string. Try echoing the $_POST... and/or assign this to a variable that is then used in the function call.
Short of creating a form to populate the post, I tried this on a php5 system with various values and got expected results for non-existent variables, nulls, strings, and numbers and could not duplicate your errors.