1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 10:18:09 +01:00
PHP-Parser/test/code/parser/expr/throw.test
2020-08-09 20:52:55 +02:00

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(
)
)
)
)
)
)