Skip to content

Commit 38f1309

Browse files
committed
Add more AST examples.
1 parent d275216 commit 38f1309

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Zend/tests/pipe_operator/ast.phpt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,34 @@ try {
6161
echo $e->getMessage(), PHP_EOL;
6262
}
6363

64+
try {
65+
assert(false && foo() |> bar() < baz());
66+
} catch (AssertionError $e) {
67+
echo $e->getMessage(), PHP_EOL;
68+
}
69+
70+
try {
71+
assert(false && (foo() |> bar()) < baz());
72+
} catch (AssertionError $e) {
73+
echo $e->getMessage(), PHP_EOL;
74+
}
75+
76+
try {
77+
assert(false && foo() |> (bar() < baz()));
78+
} catch (AssertionError $e) {
79+
echo $e->getMessage(), PHP_EOL;
80+
}
81+
82+
83+
84+
print "misc examples\n";
85+
86+
try {
87+
assert(false && foo() |> (bar() |> baz(...)));
88+
} catch (AssertionError $e) {
89+
echo $e->getMessage(), PHP_EOL;
90+
}
91+
6492
?>
6593
--EXPECT--
6694
Concat, which binds higher
@@ -74,3 +102,8 @@ assert(false && foo() . (bar() |> baz() . quux()))
74102
assert(false && foo() < bar() |> baz())
75103
assert(false && (foo() < bar()) |> baz())
76104
assert(false && foo() < bar() |> baz())
105+
assert(false && foo() |> bar() < baz())
106+
assert(false && foo() |> bar() < baz())
107+
assert(false && foo() |> (bar() < baz()))
108+
misc examples
109+
assert(false && foo() |> (bar() |> baz(...)))

0 commit comments

Comments
 (0)