1--TEST-- 2try / catch / finally 3--FILE-- 4<?php 5 6require __DIR__ . '/../util.php'; 7 8$code = <<<'PHP' 9<?php 10try { 11 echo "try"; 12} catch (Exception $e) { 13 echo "catch 1"; 14} catch (bar\FooException $e2) { 15 echo "catch 2"; 16} finally { 17 echo "finally"; 18} 19PHP; 20 21echo ast_dump(ast\parse_code($code, $version=70)), "\n"; 22 23?> 24--EXPECT-- 25AST_STMT_LIST 26 0: AST_TRY 27 try: AST_STMT_LIST 28 0: AST_ECHO 29 expr: "try" 30 catches: AST_CATCH_LIST 31 0: AST_CATCH 32 class: AST_NAME_LIST 33 0: AST_NAME 34 flags: NAME_NOT_FQ (1) 35 name: "Exception" 36 var: AST_VAR 37 name: "e" 38 stmts: AST_STMT_LIST 39 0: AST_ECHO 40 expr: "catch 1" 41 1: AST_CATCH 42 class: AST_NAME_LIST 43 0: AST_NAME 44 flags: NAME_NOT_FQ (1) 45 name: "bar\FooException" 46 var: AST_VAR 47 name: "e2" 48 stmts: AST_STMT_LIST 49 0: AST_ECHO 50 expr: "catch 2" 51 finally: AST_STMT_LIST 52 0: AST_ECHO 53 expr: "finally"