mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-07-28 01:40:15 +02:00
Add support for pipe operator
This commit is contained in:
75
test/code/parser/expr/pipe.test
Normal file
75
test/code/parser/expr/pipe.test
Normal file
@@ -0,0 +1,75 @@
|
||||
Pipe operator
|
||||
-----
|
||||
<?php
|
||||
$a |> $b |> $c;
|
||||
$a . $b |> $c . $d;
|
||||
$a |> $b == $c;
|
||||
$c == $a |> $b;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Pipe(
|
||||
left: Expr_BinaryOp_Pipe(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Pipe(
|
||||
left: Expr_BinaryOp_Concat(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_Concat(
|
||||
left: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Equal(
|
||||
left: Expr_BinaryOp_Pipe(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Equal(
|
||||
left: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
right: Expr_BinaryOp_Pipe(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
Reference in New Issue
Block a user