xref: /PHP-7.3/Zend/tests/bug47714.phpt (revision 162aa1a5)
1--TEST--
2Testing lambda function in set_exception_handler()
3--FILE--
4<?php
5function au($class) {
6        eval('class handler {
7                  function handle($e) {
8                      echo $e->getMessage()."\n";
9                  }
10              }');
11}
12
13spl_autoload_register('au');
14
15set_exception_handler(function($exception) {
16        $h = new handler();
17        $h->handle($exception);
18});
19
20throw new Exception('exception');
21?>
22--EXPECT--
23exception
24