Skip to content

Commit 2427d86

Browse files
committed
fix top level function
1 parent d553fb3 commit 2427d86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6544,16 +6544,16 @@ private function getNextUnreachableStatements(array $nodes, bool $earlyBinding):
65446544
$stmts = [];
65456545
$isPassedUnreachableStatement = false;
65466546
foreach ($nodes as $node) {
6547+
if ($earlyBinding && ($node instanceof Node\Stmt\Function_ || $node instanceof Node\Stmt\ClassLike || $node instanceof Node\Stmt\HaltCompiler)) {
6548+
continue;
6549+
}
65476550
if ($isPassedUnreachableStatement && $node instanceof Node\Stmt) {
65486551
$stmts[] = $node;
65496552
continue;
65506553
}
65516554
if ($node instanceof Node\Stmt\Nop) {
65526555
continue;
65536556
}
6554-
if ($earlyBinding && ($node instanceof Node\Stmt\Function_ || $node instanceof Node\Stmt\ClassLike || $node instanceof Node\Stmt\HaltCompiler)) {
6555-
continue;
6556-
}
65576557
if (!$node instanceof Node\Stmt) {
65586558
continue;
65596559
}

0 commit comments

Comments
 (0)