I find this ***t really ugly:
$email = (isset($email)) ? $email : '' ;
Don't get me wrong I think the ternary operator is a smart shorthand thing, but I seem to have too many of them - I acknowledge this might be a sign of other weaknesses in my code, but I digress ....
In reality they are more likely to look something like:
$user->email = ( isset($_POST['email']) ) ? $_POST['email'] : false ;
Sometimes this line can stretch on quite a ways, and it seems to contravene DRY as I am often typing the same var name twice.
so what about a function that set a var if it is not set at that point.
Behind the scenes it checks to see if $_POST['email'] has been set and if it has not add it and give it the default value, false.
Or does something like this exist and I have not seen (or not understood) it?