- ob_start: documentation ( source)
<?php
//Source: https://bugs.php.net/bug.php?id=62437
function output($buffer) {
global $object;
return $buffer . $object->bar;
}
ob_start('output');
$object = new stdClass();
$object->bar = "bar";
echo "foo ";
$test = $object;