Skip to content

Instantly share code, notes, and snippets.

@KalleZ
Created August 17, 2017 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KalleZ/cccb9edc34f492688ddc1dbe8ceaaa22 to your computer and use it in GitHub Desktop.
Save KalleZ/cccb9edc34f492688ddc1dbe8ceaaa22 to your computer and use it in GitHub Desktop.
diff --git a/main/output.c b/main/output.c
index 3eb6ddc..6fd1d78 100644
--- a/main/output.c
+++ b/main/output.c
@@ -1514,17 +1514,21 @@ PHP_FUNCTION(ob_get_status)
}
/* }}} */
-/* {{{ proto void ob_implicit_flush([int flag])
+/* {{{ proto void ob_implicit_flush([bool flag])
Turn implicit flush on/off and is equivalent to calling flush() after every output call */
PHP_FUNCTION(ob_implicit_flush)
{
- zend_long flag = 1;
+ zval *flag = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
+ ZVAL_TRUE(flag);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &flag) == FAILURE) {
return;
}
- php_output_set_implicit_flush(flag);
+ convert_to_boolean(flag);
+
+ php_output_set_implicit_flush(Z_TYPE_P(flag) == IS_TRUE ? 1 : 0);
}
/* }}} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment