With this test page:
$page = (int) $_GET['page'] ?: '1';
echo $page;
I don't understand the output I'm getting when page is undefined:
Request Result
?page=2 2
?page=3 3
?page= 1
? error: Undefined index page
Why the error message? It's PHP 5.3; why doesn't it echo "1"?