File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / general_functions / ob_start_closures.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
Test ob_start() function : closures as output handlers
--INI--
output_buffering=0
--FILE--
<?php
echo "*** Testing ob_start() : closures as output handlers ***\n";

ob_start(function ($output) {
  return 'Output (1): ' . $output;
});

ob_start(function ($output) {
  return 'Output (2): ' . $output;
});

echo "Test\nWith newlines\n";

$str1 = ob_get_contents ();

ob_end_flush();

$str2 = ob_get_contents ();

ob_end_flush();

echo $str1, $str2;

?>
===DONE===
--EXPECT--
*** Testing ob_start() : closures as output handlers ***
Output (1): Output (2): Test
With newlines
Test
With newlines
Output (2): Test
With newlines
===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>