|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patcheshandle-empty-string (last revision 2011-12-26 08:32 UTC by me at ktamura dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-12-26 08:33 UTC] me at ktamura dot com
[2012-01-17 12:23 UTC] mike@php.net
[2012-01-17 12:23 UTC] mike@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: mike
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 02:00:01 2025 UTC |
Description: ------------ If ob_start() callback returns an empty string then nothing should be printed. This is the current behavior in PHP 5.3. Behavior in PHP 5.4 is different - if a callback returns an empty string then the result is same as if it wouldn't be called at all - next call is prepended by last call value. So there is no way for callback how to discard the output. Test script: --------------- ob_start(function ($s) { fwrite(STDERR, strlen($s) . "\n"); if ($s == "b\n") { return $s; } return ""; }, 2); echo "a\n"; echo "b\n"; exit; Expected result: ---------------- 2 2 b 0 Actual result: -------------- 2 4 4