Skip to content

Commit b2273da

Browse files
committed
Verify ~ infix operator does not conflict with ~ prefix operator
1 parent 95abe9e commit b2273da

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test/php/lang/ast/syntax/php/unittest/PatternOperatorTest.class.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,15 @@ public function run($input) {
2626

2727
Assert::equals($matches, $r);
2828
}
29+
30+
#[Test]
31+
public function does_not_conflict_with_prefix_operator() {
32+
$r= $this->run('class <T> {
33+
public function run($input) {
34+
return [~0, ~$input];
35+
}
36+
}', 1);
37+
38+
Assert::equals([-1, -2], $r);
39+
}
2940
}

0 commit comments

Comments
 (0)