diff --git a/MD_STD.php b/MD_STD.php index 77a14dd..2bb1f55 100644 --- a/MD_STD.php +++ b/MD_STD.php @@ -67,6 +67,20 @@ class MD_STD { } + /** + * Type safe wrapper around ob_get_clean(): Gets the current buffer + * contents and delete current output buffer. + * + * @return string + */ + public static function ob_get_clean():string { + + $output = ob_get_clean(); + if ($output === false) throw new MDOutputBufferNotStarted("Output buffer was not started"); + return $output; + + } + /** * Function checking if a string starts with another. *