if(cond)
var = "hello world";
else
var = 42;
I've sometimes wished for this functionality. It's not even a big deal in a statically typed language with built-in algebraic types and flow-based typing. The type of var is just String|Integer, and you have to disambiguate before you use its value.
