Get Defined Variables in Current Scope

Get all defined variables in current scope. The variable can be defined in included files, cookie, and session. Variable can come from $_GET, $_POST etc also. This script will give you all those variables which are in current scope. Even you can exclude the variable you do not want to get included in the report.
Test page for checking defined variables in current scope:

setcookie('name', 'satya');
$testVar = "variable value";
$_SESSION['sess_var'] = 'sess_var';
echo '<pre>';
$msg = 'hello';
// not to mention in list of variables defined
$nothingToThinkAbout = 'do not consider in current scope';
function testScopeVarInFuncton()
 global $testVar;
 $localVar = 'a var within function';
 include '';
include '';
<form method=post action="">
<input type=text value="" name="age">
<input type=submit name="s">
The file which can be included in any php page and then that will tell all the variables defined in current scope.

 // Get all defined vars upto here.
 $definedVars = array_keys(get_defined_vars());
 // list of variables not to be considered for scope
 // if variable $nothingToThinkAbout is defined then do not consider
 $arr1 = explode (',', $doNotConsider);
 $vars = array_diff($definedVars, $arr1);
 foreach ($vars as $k=>$v) {
  if (! is_array($$v)) {
   echo "111 . $v" . '=>' . $$v;
  else if (count($v) > 0){
   echo "222 . $v" . '=>';
  echo '<br>';