summaryrefslogtreecommitdiff
path: root/tests/output/bug70970.phpt
blob: 902d872b9a0be0ee25f54f45587be3b04391b188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Bug #70970 (Segfault when combining error handler with output buffering)
--FILE--
<?php
function exception_error_handler($severity, $message, $file, $line)
{
    throw new Exception($message, 0);
}

set_error_handler('exception_error_handler');

function obHandler($buffer, $phase = null)
{
    try {
        ob_start();
    } catch (Exception $e) {
        return (string) $e;
    }

    return $buffer;
}

ob_start('obHandler');

print 'test';
?>
--EXPECTF--
Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %sbug70970.php on line %d