Skip to content

Commit b80c37d

Browse files
committed
Fix test
1 parent a90e2dc commit b80c37d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ext/standard/tests/general_functions/is_countable_with_variables.phpt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ if (is_countable($foo)) {
1616

1717
$bar = null;
1818
if (!is_countable($bar)) {
19-
count($bar);
19+
try {
20+
count($bar);
21+
} catch (\TypeError $e) {
22+
echo $e->getMessage() . \PHP_EOL;
23+
}
2024
}
2125
?>
22-
--EXPECTF--
26+
--EXPECT--
2327
bool(true)
2428
bool(true)
2529
bool(false)
2630
int(2)
27-
28-
Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d
31+
count(): Argument #1 ($var) must be of type Countable|array, null given

0 commit comments

Comments
 (0)