|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-08-05 11:05 UTC] sniper@php.net
  [2003-08-08 01:09 UTC] d dot stogov at turck dot spb dot ru
  [2003-08-08 11:49 UTC] iliaa@php.net
  [2003-08-08 18:44 UTC] iliaa@php.net
  [2003-08-11 00:52 UTC] d dot stogov at turck dot spb dot ru
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 05:00:02 2025 UTC | 
Description: ------------ The C function "php_end_ob_buffer" from "main/output.c" destroys output_handler on first call so the second call to output_handler is not possible. "php_end_ob_buffer" is called by "ob_flush()" and "ob_clean()" those must not destroy output handler. Look into line 250: zval_ptr_dtor(&OG(active_ob_buffer).output_handler); The same error is in PHP-4.3.3RC2 too. Reproduce code: --------------- <?php function test($s,$mode) { return (($mode & PHP_OUTPUT_HANDLER_START)?"[":""). $s. (($mode & PHP_OUTPUT_HANDLER_END)?"]\n":""); } function t1() { ob_start("test"); echo "Hello from t1 1 "; echo "Hello from t1 2 "; ob_end_flush(); } function t2() { ob_start("test"); echo "Hello from t2 1 "; ob_flush(); echo "Hello from t2 2 "; ob_end_flush(); } function t3() { ob_start("test"); echo "Hello from t3 1 "; ob_clean(); echo "Hello from t3 2 "; ob_end_flush(); } t1(); echo "\n"; t2(); echo "\n"; t3(); echo "\n"; ?> Expected result: ---------------- [Hello from t1 1 Hello from t1 2 ] [Hello from t2 1 Hello from t2 2] [Hello from t3 2] Actual result: -------------- [Hello from t1 1 Hello from t1 2 ] [Hello from t2 1 Hello from t2 2 Hello from t3 2