I think I'd prefer to cast $v to a string - empty() is rather loose in PHP as it matches quiet a few things. I'll update the code now with what I think makes sense.