Annotation of embedaddon/php/ext/standard/tests/general_functions/ob_start_closures.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test ob_start() function : closures as output handlers
! 3: --INI--
! 4: output_buffering=0
! 5: --FILE--
! 6: <?php
! 7: echo "*** Testing ob_start() : closures as output handlers ***\n";
! 8:
! 9: ob_start(function ($output) {
! 10: return 'Output (1): ' . $output;
! 11: });
! 12:
! 13: ob_start(function ($output) {
! 14: return 'Output (2): ' . $output;
! 15: });
! 16:
! 17: echo "Test\nWith newlines\n";
! 18:
! 19: $str1 = ob_get_contents ();
! 20:
! 21: ob_end_flush();
! 22:
! 23: $str2 = ob_get_contents ();
! 24:
! 25: ob_end_flush();
! 26:
! 27: echo $str1, $str2;
! 28:
! 29: ?>
! 30: ===DONE===
! 31: --EXPECT--
! 32: *** Testing ob_start() : closures as output handlers ***
! 33: Output (1): Output (2): Test
! 34: With newlines
! 35: Test
! 36: With newlines
! 37: Output (2): Test
! 38: With newlines
! 39: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>