summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/basic_functions.c1
-rw-r--r--main/output.c8
-rw-r--r--main/php_output.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 4d2d5f50e7..e31138f88d 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -725,6 +725,7 @@ function_entry basic_functions[] = {
PHP_FE(ob_end_flush, NULL)
PHP_FE(ob_end_clean, NULL)
PHP_FE(ob_get_length, NULL)
+ PHP_FE(ob_get_level, NULL)
PHP_FE(ob_get_contents, NULL)
PHP_FE(ob_implicit_flush, NULL)
diff --git a/main/output.c b/main/output.c
index 92f2ef2d3d..80b9a0bb34 100644
--- a/main/output.c
+++ b/main/output.c
@@ -575,6 +575,14 @@ PHP_FUNCTION(ob_get_contents)
}
/* }}} */
+/* {{{ proto integer ob_get_level(void)
+ Return the nesting level of the output buffer */
+PHP_FUNCTION(ob_get_level)
+{
+ RETURN_LONG (OG(ob_nesting_level));
+}
+/* }}} */
+
/* {{{ proto string ob_get_length(void)
Return the length of the output buffer */
PHP_FUNCTION(ob_get_length)
diff --git a/main/php_output.h b/main/php_output.h
index e8d1f2f7b0..191b0322b5 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -49,6 +49,7 @@ PHP_FUNCTION(ob_end_flush);
PHP_FUNCTION(ob_end_clean);
PHP_FUNCTION(ob_get_contents);
PHP_FUNCTION(ob_get_length);
+PHP_FUNCTION(ob_get_level);
PHP_FUNCTION(ob_implicit_flush);
typedef struct _php_ob_buffer {