Skip to content

Commit 8957cdd

Browse files
committed
Update comparison precedence test.
1 parent d836c17 commit 8957cdd

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Zend/tests/pipe_operator/precedence_comparison.phpt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,21 @@ function _test1(int $a): int {
77
return $a * 2;
88
}
99

10-
// This will error without the parens,
11-
// as it will try to compare a closure to an int first.
1210
$res1 = (5 |> _test1(...)) == 10 ;
1311
var_dump($res1);
1412

13+
// This will error without the parens,
14+
// as it will try to compare a closure to an int first.
15+
try {
16+
$res1 = 5 |> _test1(...) == 10 ;
17+
}
18+
catch (Throwable $e) {
19+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
20+
}
21+
1522
?>
16-
--EXPECT--
23+
--EXPECTF--
1724
bool(true)
25+
26+
Notice: Object of class Closure could not be converted to int in %s line %d
27+
Error: Value of type bool is not callable

0 commit comments

Comments
 (0)