We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a90e2dc commit b80c37dCopy full SHA for b80c37d
ext/standard/tests/general_functions/is_countable_with_variables.phpt
@@ -16,13 +16,16 @@ if (is_countable($foo)) {
16
17
$bar = null;
18
if (!is_countable($bar)) {
19
- count($bar);
+ try {
20
+ count($bar);
21
+ } catch (\TypeError $e) {
22
+ echo $e->getMessage() . \PHP_EOL;
23
+ }
24
}
25
?>
---EXPECTF--
26
+--EXPECT--
27
bool(true)
28
29
bool(false)
30
int(2)
-
-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