xref: /PHP-7.4/Zend/tests/closure_021.phpt (revision a142b6cd)
1--TEST--
2Closure 021: Throwing exception inside lambda
3--FILE--
4<?php
5
6$foo = function() {
7	try {
8		throw new Exception('test!');
9	} catch(Exception $e) {
10		throw $e;
11	}
12};
13
14try {
15	$foo();
16} catch (Exception $e) {
17	var_dump($e->getMessage());
18}
19
20?>
21--EXPECT--
22string(5) "test!"
23