public function _getNext(&$tokens, $key, $whatToGet, $maxDist = 0)
{
$start = $key;
$key++;
if (!is_array($whatToGet)) {
$whatToGet = array($whatToGet);
}
while (!is_array($tokens[$key]) || !in_array($tokens[$key][0], $whatToGet)) {
$key++;
if (!isset($tokens[$key]) || 0 < $maxDist && $key - $start > $maxDist) {
return FALSE;
}
}
return $tokens[$key][1];
}