mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-13 09:37:21 +01:00
48 lines
1.1 KiB
Plaintext
48 lines
1.1 KiB
Plaintext
Throw expression
|
|
-----
|
|
<?php
|
|
test(throw $x);
|
|
$a ?? throw new Exception;
|
|
-----
|
|
!!php7
|
|
array(
|
|
0: Stmt_Expression(
|
|
expr: Expr_FuncCall(
|
|
name: Name(
|
|
parts: array(
|
|
0: test
|
|
)
|
|
)
|
|
args: array(
|
|
0: Arg(
|
|
name: null
|
|
value: Expr_Throw(
|
|
expr: Expr_Variable(
|
|
name: x
|
|
)
|
|
)
|
|
byRef: false
|
|
unpack: false
|
|
)
|
|
)
|
|
)
|
|
)
|
|
1: Stmt_Expression(
|
|
expr: Expr_BinaryOp_Coalesce(
|
|
left: Expr_Variable(
|
|
name: a
|
|
)
|
|
right: Expr_Throw(
|
|
expr: Expr_New(
|
|
class: Name(
|
|
parts: array(
|
|
0: Exception
|
|
)
|
|
)
|
|
args: array(
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
) |