File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / output / ob_start_callbacks.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 8 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() with callbacks in variables
--FILE--
<?php 

// Closure in variable
$a = function ($s) { return strtoupper($s); };
ob_start($a);
echo 'closure in variable', "\n";
ob_end_flush();

// Object (array) in variable
class foo {
	static function out($foo) {
		return strtoupper($foo);
	}
}
$a = array('foo', 'out');
ob_start($a);
echo 'object in variable', "\n";
ob_end_flush();

// Object with static array
ob_start(array('foo', 'out'));
echo 'object via static array', "\n";
ob_end_flush();

function my_strtoupper($foo, $bar) {
	return strtoupper($foo);
}
$a = 'my_strtoupper';
ob_start($a);
echo 'function via variable', "\n";
ob_end_flush();
--EXPECT--
CLOSURE IN VARIABLE
OBJECT IN VARIABLE
OBJECT VIA STATIC ARRAY
FUNCTION VIA VARIABLE

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