请教下关于resetstd方法的问题

ayamzh
global $STDOUT, $STDERR;
$handle = fopen(self::$stdoutFile, "a");
if ($handle) {
    unset($handle);
    @fclose(STDOUT);
    @fclose(STDERR);
    $STDOUT = fopen(self::$stdoutFile, "a");
    $STDERR = fopen(self::$stdoutFile, "a");
} else {
    throw new Exception('can not open stdoutFile ' . self::$stdoutFile);
}

源码是这样的,定义了两个全局变量,但是并没有地方往这两个句柄里写入数据啊。

2622 1 0
1个回答

ayamzh

这个问题知道了 PHP关闭标准输出后 会把下一个代开的文件作为标准输出

  • 暂无评论
年代过于久远,无法发表回答
🔝