- ob_start: documentation ( source)
- register_shutdown_function: documentation ( source)
- set_exception_handler: documentation ( source)
<?php
class foo
{
protected $buffer = false;
function bar($b)
{
$this->buffer = $b;
return '';
}
function eh($e)
{
ob_start(array($this, 'bar'));
echo '123';
}
}
function sh()
{
return;
}
register_shutdown_function('sh');
set_exception_handler(array(new foo, 'eh'));
throw new Exception;