ID:               23826
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jc at mega-bucks dot co dot jp
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
-Operating System: Red Hat Linux 8.0
+Operating System: ANY
 PHP Version:      4.3.2RC4
-Assigned To:      
+Assigned To:      helly
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

1) It is a notice and not an error
2) this notice tells you: you are doing unnecessary stuff
3) to clear all buffers do: while(@ob_end_clean());


Previous Comments:
------------------------------------------------------------------------

[2003-05-27 10:12:58] [EMAIL PROTECTED]

Why do you want to check before calling ob_end_clean()? It seems you
simply want to call that then why not @ob_end_clean()?

------------------------------------------------------------------------

[2003-05-27 03:19:41] jc at mega-bucks dot co dot jp

Ok. I understand the "bug fix" but that fix now causes another problem
...

I have a custom error handler with the following code:

$buffer = ob_get_contents();
ob_end_clean();

The call to ob_end_clean() will throw a notice if the buffer if empty,
which will cause the error handler to either fail or call itself again
(possibly infinitely?).

So just to be clear, it seems you are saying that *technically* 
calling ob_end_clean() on an empty buffer is incorrect?

If this is so, what is the proprer way of checking if the buffer is
empty before calling ob_end_clean()?

If there is a way of checking wether the buffer is empty or not then
all is fine, if not then there is a problem ;)

------------------------------------------------------------------------

[2003-05-27 03:10:02] [EMAIL PROTECTED]

You don't need to submit anymore bug reports..

And I meant with that crash preventing that it now throws
an error and returns false, reviously when it didn't check
the buffer, it just crashed. (that was the fix)



------------------------------------------------------------------------

[2003-05-27 02:23:47] jc at mega-bucks dot co dot jp

>The notice was added to prevent it from crashing with empty buffers

I must be missing something ... how does throwing a notice prevent
anything from crashing? Or do you mean there is absolutely no way to
check that the output buffer is empty *except* to call ob_end_clean()
and check to see if a notice was thrown or not?

If that's the case then ... ouch.

>Docs should mention this though.

That would be nice ;) Does re-categorizing it as a documentation
problem mean that someone will get around to it or should I submit a
new documentation bug report?

Thanks!

------------------------------------------------------------------------

[2003-05-27 02:17:44] [EMAIL PROTECTED]

The notice was added to prevent it from crashing with empty buffers.
Just use @ in front of it if it bothers you.
Docs should mention this though.



------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/23826

-- 
Edit this bug report at http://bugs.php.net/?id=23826&edit=1


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to