In Ruby you can easily set a default value for a variable
x ||= \"default\"
The above statement will set the value of x to \"default\" if
As of PHP 5.3 you can use the ternary operator while omitting the middle argument:
$x = $x ?: 'default';