Jump to content

[SOLVED] Does PHP clean up properly at the end of file if an ob_start is unflushed?


da__smith

Recommended Posts

Hi PHP Freaks

 

 

Does PHP clean up properly (i.e. ob_flush();flush();)  if an ob_start is unflushed/uncleaned before the end of the PHP file?

PHP version 5 is in use.

 

To illustrate the question I know that the following, very much simplified, example outputs PHP/HTML to the browser:

 

---PHP file, called by the browser, start---

 

ob_start();

...PHP/HTML

 

---PHP file, called by the browser, end---

 

The buffer is outputted to the browser, which means that PHP flushes at the end of the PHP file. Does PHP flush/clean *everything* at the end of the file? Will there be any server/PHP issues with this?

 

 

all the best

Dave

 

Link to comment
Share on other sites

PHP cleans up EVERYTHING at the end of any http request so whether it's flushed or not shouldn't affect anything being held in memory after the request has been completed.

 

If only we actually had persistence in PHP (without sessions)... "oh hark ye olde days of desktop programming!"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.