1--TEST-- 2Properly handle exceptions going to be uncaught 3--PHPDBG-- 4r 5t 6ev 1 + 2 7c 8q 9--EXPECTF-- 10[Successful compilation of %s] 11prompt> handle first 12[Uncaught Error in %s on line 16: Call to undefined function foo()] 13>00016: foo(); // Error 14 00017: } catch (\Exception $e) { 15 00018: var_dump($e); 16prompt> frame #0: {closure}() at %s:16 17frame #1: {main} at %s:22 18prompt> 3 19prompt> [Uncaught Error in %s on line 16] 20Error: Call to undefined function foo() in %s:16 21Stack trace: 22#0 %s(22): {closure}() 23#1 {main} 24[Script ended normally] 25prompt> 26--FILE-- 27<?php 28 29(function() { 30 try { 31 foo(); // Error 32 } catch (\Exception $e) { 33 var_dump($e); 34 } finally { 35 print "handle first\n"; 36 return "ok"; 37 } 38})(); 39 40(function() { 41 try { 42 foo(); // Error 43 } catch (\Exception $e) { 44 var_dump($e); 45 } catch (\ParseError $e) { 46 var_dump($e); 47 } 48})(); 49