123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- Try/catch
- -----
- <?php
- try {
- doTry();
- } catch (A $b) {
- doCatchA();
- } catch (B $c) {
- doCatchB();
- } finally {
- doFinally();
- }
- // no finally
- try { }
- catch (A $b) { }
- // no catch
- try { }
- finally { }
- -----
- array(
- 0: Stmt_TryCatch(
- stmts: array(
- 0: Expr_FuncCall(
- name: Name(
- parts: array(
- 0: doTry
- )
- )
- args: array(
- )
- )
- )
- catches: array(
- 0: Stmt_Catch(
- types: array(
- 0: Name(
- parts: array(
- 0: A
- )
- )
- )
- var: b
- stmts: array(
- 0: Expr_FuncCall(
- name: Name(
- parts: array(
- 0: doCatchA
- )
- )
- args: array(
- )
- )
- )
- )
- 1: Stmt_Catch(
- types: array(
- 0: Name(
- parts: array(
- 0: B
- )
- )
- )
- var: c
- stmts: array(
- 0: Expr_FuncCall(
- name: Name(
- parts: array(
- 0: doCatchB
- )
- )
- args: array(
- )
- )
- )
- )
- )
- finally: Stmt_Finally(
- stmts: array(
- 0: Expr_FuncCall(
- name: Name(
- parts: array(
- 0: doFinally
- )
- )
- args: array(
- )
- )
- )
- )
- )
- 1: Stmt_TryCatch(
- stmts: array(
- )
- catches: array(
- 0: Stmt_Catch(
- types: array(
- 0: Name(
- parts: array(
- 0: A
- )
- )
- )
- var: b
- stmts: array(
- )
- )
- )
- finally: null
- comments: array(
- 0: // no finally
- )
- )
- 2: Stmt_TryCatch(
- stmts: array(
- )
- catches: array(
- )
- finally: Stmt_Finally(
- stmts: array(
- )
- )
- comments: array(
- 0: // no catch
- )
- )
- )
|