Add support for pipe operator

This commit is contained in:
Nikita Popov
2025-07-20 18:43:38 +02:00
parent c1f6c4c8d8
commit b815a165bd
11 changed files with 1111 additions and 996 deletions

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