Forum Moderators: coopster
(boolval($img)) ?: $img = ($imgTwo ?: 'default.gif');
// 2.2482872009277
if (!isset($img))
$img = $imgTwo;
if (!isset($img))
$img = 'default.gif';
// 2.6202201843262
// I also get warnings if $img and $imgTwo aren't defined, but using ? throws an error so I'm
// not sure what the best solution is there
(boolval($img)) ?: $img = ($imgTwo ?: 'default.gif');
// 1.5783309936523
$img = $img ? $imgTwo ? 'default.gif';