简单的PHP IF语句无法正确评估

This PHP IF statement always results in 'false' and I can't figure out why. Any help is greatly appreciated.

Where $i is passed in as 0 and $j is passed in as 4 (these numbers were verified in the POST)

$i = $_POST['entry'];
$j = $_POST['j'];

function tabs() {
  if ($i < $j)
    echo 'i is less than j';
  else
    echo 'false';
};

$i and $j are not within the visible scope of tabs():

… [W]ithin user-defined functions a local function scope is introduced. Any variable used inside a function is by default limited to the local function scope.

Pass them as parameters or make them global (the first being the preferred way):

Parameters

$i = $_POST['entry'];
$j = $_POST['j'];

function tabs($i, $j) {
  if ($i < $j)
    echo 'i is less than j';
  else
    echo 'false';
};

tabs($i, $j);

Global

$i = $_POST['entry'];
$j = $_POST['j'];

function tabs() {
  global $i, $j;
  if ($i < $j)
    echo 'i is less than j';
  else
    echo 'false';
};

tabs();

EDIT
Alternatively, you can access the superglobal $_POST array from within the tabs() function directly, or $_GLOBALS['i'] and $_GLOBALS['j'], respectively.