A shorter way for getting variables
Since PHP 5.3 you can use the shortcut $a = $b? : $c:

$this-&gt;uniqueSessionKey = $settings-&gt;get('uniqueSessionKey') ?  : $_SERVER['HTTP_USER_AGENT'] . time();


--

Just a note: you can not use this if you want check if the var $a is set. In this case you must use the original form: $a = isset($b)? $b : $c;

Otherwise, you can write a custom function in this way:

function getIfSet(&amp;$a, $default = null) {
      return isset($a)? $a : $default;
} 

$a = getIfSet($b,$c);


Passing var by reference (&amp;$a) avoid the PHP notice if $a is not set.