Skip to content

Commit 4606ae5

Browse files
committed
Test that not comparable objects with the same number of properties are just considered equivalent
1 parent bc33efe commit 4606ae5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/standard/tests/math/clamp.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ var_dump(clamp(12, null, 10));
2929
var_dump(clamp(-9999, 5, null));
3030
var_dump(clamp(12, 5, null));
3131

32+
$a = new \InvalidArgumentException('a');
33+
$b = new \RuntimeException('b');
34+
$c = new \LogicException('c');
35+
echo clamp($a, $b, $c)::class, "\n";
36+
echo clamp($b, $a, $c)::class, "\n";
37+
echo clamp($c, $a, $b)::class, "\n";
38+
3239
try {
3340
var_dump(clamp(4, NAN, 6));
3441
} catch (ValueError $error) {
@@ -70,6 +77,9 @@ int(-9999)
7077
int(10)
7178
int(5)
7279
int(12)
80+
InvalidArgumentException
81+
RuntimeException
82+
LogicException
7383
clamp(): Argument #2 ($min) cannot be NAN
7484
clamp(): Argument #3 ($max) cannot be NAN
7585
clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)

0 commit comments

Comments
 (0)