summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 71f5093d31..c4378186bd 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -131,7 +131,9 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_
if (type == 1) {
PHPWRITE(buf, bufl);
- sapi_flush(TSRMLS_C);
+ if (OG(ob_nesting_level) < 1) {
+ sapi_flush(TSRMLS_C);
+ }
} else if (type == 2) {
/* strip trailing whitespaces */
l = bufl;