diff --git a/src/NodeVisitors/GlobalVarVisitor.php b/src/NodeVisitors/GlobalVarVisitor.php
index <HASH>..<HASH> 100644
--- a/src/NodeVisitors/GlobalVarVisitor.php
+++ b/src/NodeVisitors/GlobalVarVisitor.php
@@ -23,7 +23,7 @@ class GlobalVarVisitor extends PhpParser\NodeVisitorAbstract
         $obj = new NodeWrapper ($node);
 
         // check for global variables
-        if ($obj->isGlobal() && $this->scope->insideClass()) 
+        if ($obj->isGlobal() && !$this->scope->inGlobalSpace()) 
         {
             $scope = $this->scope->getScopeName();
 
diff --git a/testFile.php b/testFile.php
index <HASH>..<HASH> 100644
--- a/testFile.php
+++ b/testFile.php
@@ -63,4 +63,8 @@ thisScrewsTheFile();
 
 BadThings::happen();
 
+global $thingy;
+
+$y = $_GET['y'];
+
 $BLAH = 'ugly';
\ No newline at end of file
Global variables weren't matching in global functions