diff --git a/src/parser/xhpast/api/XHPASTNode.php b/src/parser/xhpast/api/XHPASTNode.php --- a/src/parser/xhpast/api/XHPASTNode.php +++ b/src/parser/xhpast/api/XHPASTNode.php @@ -269,8 +269,8 @@ $body = $namespace->getChildByIndex(1); if ($body->getTypeName() != 'n_EMPTY') { - if ($body->containsDescendant($this)) { - return self::getNamespaceName($namespace); + if (!$body->containsDescendant($this)) { + continue; } }