]> granicus.if.org Git - php/commitdiff
Move variable declaration closer to its usage
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sat, 4 Apr 2020 22:03:08 +0000 (00:03 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Sat, 4 Apr 2020 22:03:08 +0000 (00:03 +0200)
build/gen_stub.php

index ecad6fd81db7a33b99dadd60b159e8bc66f5f3c8..fd8caffaf670d18eda6da110a1a2c4367f05704c 100755 (executable)
@@ -743,7 +743,6 @@ function generateCodeWithConditions(
 }
 
 function generateArgInfoCode(FileInfo $fileInfo): string {
-    $generatedDeclarations = [];
     $funcInfos = $fileInfo->funcInfos;
 
     $code = "/* This is a generated file, edit the .stub.php file instead. */\n";
@@ -768,6 +767,7 @@ function generateArgInfoCode(FileInfo $fileInfo): string {
 
     if ($fileInfo->generateFunctionEntries) {
         $code .= "\n\n";
+        $generatedDeclarations = [];
         $code .= generateCodeWithConditions($funcInfos, "", function(FuncInfo $funcInfo) use (&$generatedDeclarations) {
             $name = $funcInfo->alias ?? $funcInfo->name;
             $key = "$name|$funcInfo->cond";