]> granicus.if.org Git - php/commitdiff
run-tests: Don't die unnecessarily
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 21 Jun 2019 15:08:24 +0000 (17:08 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 25 Jun 2019 12:28:58 +0000 (14:28 +0200)
die/exit leak memory, don't use them if we don't need to.

run-tests.php

index 9d20304c25f08457db39b344cd2bcd6912867c49..c684a0657603f1aa94a808000ce2f12e15fa4002 100755 (executable)
@@ -63,7 +63,7 @@ function main()
        if (getenv("TEST_PHP_WORKER")) {
                $workerID = intval(getenv("TEST_PHP_WORKER"));
                run_worker();
-               die;
+               return;
        }
 
        define('INIT_DIR', getcwd());
@@ -733,7 +733,7 @@ HELP;
                                exit(1);
                        }
 
-                       exit(0);
+                       return;
                }
        }
 
@@ -1731,11 +1731,9 @@ function run_worker() {
                                        "type" => "error",
                                        "msg" => "Unrecognised message type: $command[type]"
                                ]);
-                               die;
+                               break 2;
                }
        }
-
-       die;
 }
 
 //