On 17.11.2011, at 21:46, Matthew Weier O'Phinney wrote:

> * ob_get_clean() now raises a notice if no buffer to delete
>   Prior to 5.4.0RC1, if there were no buffers left to delete,
>   ob_get_clean() was silent. It now raises a notice -- which, when
>   using PHPUnit, means an error is now raised, making the test fail.
>   I do not see any benefit to raising the notice; if there's nothing
>   left to clean, return an empty string or false (which was the former
>   behavior, and is documented). 

I've looked into this for the purpose of coming up with a patch, and judging 
from the tests and also behavior in PHP 5.3, it doesn't seem that simple.

First of all, ob_clean() and ob_end_clean() will raise the same notice even in 
PHP 5.3. It seems inconsistent to me to treat these three differently, so in 
that regard, PHP 5.4 is actually fixing behavior (although arguably the other 
way to approach the problem is to remove the notice from all three of them).

Also, the documentation states for ob_get_clean():
"ob_get_clean() essentially executes both ob_get_contents() and ob_end_clean()."

Since ob_end_clean() currently raises the notice, it'd not be unreasonable to 
expect it for ob_get_clean() as well.

David

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to