Using the ternary operator can be helpful. Not everyone finds ternary operations to be easily readable. A matter of preference, I suppose.
function unsignedInt($int) {
return (int) $int >= 0 ? (int) $int : 0;
}
$start = unsignedInt($_GET['s']);
Although this could still potentially show warnings (the function doesn't ensure $_GET['s'] exists), so I would personally probably declare my expected get vars at the top of the script:
$_GET['s'] = isset($_GET['s']) ? $_GET['s'] : '';
And since the function is incredibly similar, I might do it all in that variable declaration instead of going with the function:
$start = isset($_GET['s']) && (int) $_GET['s'] >= 0 ? (int) $_GET['s'] : 0;
So I suppose it depends on how you plan to use this method in your code.