$cmd = 'git log';
$result = null;
$process = proc_open($cmd, [1 => ['pipe', 'w']], $pipes, null, null, array('suppress_errors' => true));
if (\is_resource($process)) {
$result = stream_get_contents($pipes[1]);
fclose($pipes[1]);
proc_close($process);
}
var_dump($result);