Skip to content

Commit fb20139

Browse files
committed
Fix sapi/cli
1 parent 42840f6 commit fb20139

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

sapi/cli/tests/gh8827-003.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ $stdoutStream = fopen('php://stdout', 'r');
1616

1717
$stdoutFile = tempnam(sys_get_temp_dir(), 'gh8827');
1818
$stderrFile = tempnam(sys_get_temp_dir(), 'gh8827');
19-
register_shutdown_function(function () use ($stdoutFile, $stderrFile) {
19+
register_shutdown_function(function ($stdoutFile, $stderrFile) {
2020
unlink($stdoutFile);
2121
unlink($stderrFile);
22-
});
22+
}, $stdoutFile, $stderrFile);
2323

2424
fclose(STDOUT);
2525
fclose(STDERR);

sapi/cli/tests/php_cli_server.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function php_cli_server_start(
9797
}
9898

9999
register_shutdown_function(
100-
function($handle) use($router, $doc_root, $output_file) {
100+
function($handle, $router, $doc_root, $output_file) {
101101
proc_terminate($handle);
102102
$status = proc_get_status($handle);
103103
if ($status['exitcode'] !== -1 && $status['exitcode'] !== 0
@@ -108,7 +108,10 @@ function php_cli_server_start(
108108
@unlink(__DIR__ . "/{$router}");
109109
remove_directory($doc_root);
110110
},
111-
$handle
111+
$handle,
112+
$router,
113+
$doc_root,
114+
$output_file
112115
);
113116

114117
// Define the same "constants" we previously did.

0 commit comments

Comments
 (0)