nkarmi
nkarmi

Reputation: 277

Is the output buffer flushed automatically?

Should I flush the buffer after calling ob_start() or will it be flushed automatically? If I'm not calling ob_flush() does it affect the website performance.

Upvotes: 4

Views: 595

Answers (1)

Lorenzo Marcon
Lorenzo Marcon

Reputation: 8169

The output is flushed automatically, you can test it with a simple script like this:

<?php
ob_start();
echo "Hello";
?>

The performances are the same, since it's flushed automatically.

Upvotes: 1

Related Questions