summaryrefslogtreecommitdiff
path: root/Zend/tests/bug60909_2.phpt
blob: d08d9f90fa25e6adba52dd81220394cfa3de9843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
--FILE--
<?php
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");});

class Bad {
    public function __toString() {
        throw new Exception('Oops, I cannot do this');
    }
}

$bad = new Bad();
echo "$bad";
--EXPECTF--
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0


!!!shutdown!!!