Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Get the contents of the active output buffer and turn it off
<?php ob_get_clean(): string|false
<?php             $image = imagecreatetruecolor($width, $height);



            if (! function_exists($functionName = "image{$extension}")) {

                ob_get_clean();



                throw new LogicException("{$functionName} function is not defined and image cannot be generated.");

            }
<?php             call_user_func($functionName, $image);



            fwrite($temp, ob_get_clean());

        });

    }

}
<?php     protected function componentData()

    {

        $defaultSlot = new ComponentSlot(trim(ob_get_clean()));



        $slots = array_merge([

            '__default' => $defaultSlot,
<?php         [$currentName, $currentAttributes] = $currentSlot;



        $this->slots[$this->currentComponent()][$currentName] = new ComponentSlot(

            trim(ob_get_clean()), $currentAttributes

        );

    }
<?php         $last = array_pop($this->fragmentStack);



        $this->fragments[$last] = ob_get_clean();



        return $this->fragments[$last];

    }
<?php         $last = array_pop($this->sectionStack);



        if ($overwrite) {

            $this->sections[$last] = ob_get_clean();

        } else {

            $this->extendSection($last, ob_get_clean());

        }
<?php         if ($overwrite) {

            $this->sections[$last] = ob_get_clean();

        } else {

            $this->extendSection($last, ob_get_clean());

        }



        return $last;
<?php         $last = array_pop($this->sectionStack);



        if (isset($this->sections[$last])) {

            $this->sections[$last] .= ob_get_clean();

        } else {

            $this->sections[$last] = ob_get_clean();

        }
<?php         if (isset($this->sections[$last])) {

            $this->sections[$last] .= ob_get_clean();

        } else {

            $this->sections[$last] = ob_get_clean();

        }



        return $last;
<?php         }



        return tap(array_pop($this->pushStack), function ($last) {

            $this->extendPush($last, ob_get_clean());

        });

    }
<?php         }



        return tap(array_pop($this->pushStack), function ($last) {

            $this->extendPrepend($last, ob_get_clean());

        });

    }
<?php     public function renderTranslation()

    {

        return $this->container->make('translator')->get(

            trim(ob_get_clean()), $this->translationReplacements

        );

    }

}
<?php             $this->handleViewException($e, $obLevel);

        }



        return ltrim(ob_get_clean());

    }
<?php         ob_start();

        $response->sendContent();

        $content = ob_get_clean();



        $this->assertInstanceOf(StreamedResponse::class, $response);

        $this->assertSame('Hello World', $content);
<?php         ob_start();

        eval(" ?> $template <?php endif; ");

        ob_get_clean();

    }

}