Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Get the contents of the active output buffer and turn it off
<?php ob_get_clean(): string|false
<?php         ob_start();

        phpinfo(INFO_GENERAL);

        $phpinfo = ob_get_clean();

        if (Preg::isMatch('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) {

            $configure = $match[1];
<?php         ob_start();

        $reflector->info();



        return ob_get_clean();

    }

}
<?php         $process = new ProcessExecutor;

        ob_start();

        $process->execute('echo foo');

        $output = ob_get_clean();

        $this->assertEquals("foo".PHP_EOL, $output);

    }