Am I ok to call a function with a variable that might not be set?
<p>I am creating functions in my code to clean it up, one of them is for working out the offset for pagination.</p>

<p>The function is</p>

<pre><code>function pageOffSet($page, $count, $resultsPerPage) {
     // WORK OUT HIGHEST PAGE NUMBER
     $pageCount = ceil($count / $resultsPerPage);
     // IF GET PAGE VARIABLE IS HIGHER THAN MAX PAGE POSSIBLE
     if (isset($page) &amp;&amp; $page &gt; $pageCount) {
          $page = $pageCount;
     // IF VALID GET PAGE VARIABLE
     } elseif (isset($page) &amp;&amp; is_numeric($page) &amp;&amp; $page &gt; 1) { 
          $page = $page;
     // IF PAGE GET VARIABLE NOT SET
     } else { 
          $page = 1;
     }
     // OFFSET FOR POST RESULTS
     $offSet = ($page - 1) * $resultsPerPage;
     return array('offSet' =&gt; $offSet, 'resultsPerPage' =&gt; $resultsPerPage);
}
</code></pre>

<p>And I call it like,</p>

<pre><code>$page = pageOffSet($_GET['page'], $count, 15);
</code></pre>

<p>Except <code>$_GET['page']</code> may be set or unset? I check inside the function to see if it is set or not, but is it ok to do this? I get no errors but I just want to check?</p>
