From 84557e12a410158f8c7a1796dedca5e7c50f970f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 31 Aug 2020 00:26:49 +0200 Subject: [PATCH] Improve error message for count() --- Zend/tests/generators/errors/count_error.phpt | 2 +- Zend/zend_vm_def.h | 2 +- Zend/zend_vm_execute.h | 7 +- ext/standard/array.c | 6 +- ext/standard/basic_functions.stub.php | 4 +- ext/standard/tests/array/count_invalid.phpt | 12 +- ext/standard/tests/array/count_recursive.phpt | 18 +-- ext/standard/tests/array/sizeof_basic1.phpt | 12 +- ext/standard/tests/array/sizeof_object2.phpt | 30 ++--- .../tests/array/sizeof_variation1.phpt | 114 ++++++++--------- .../tests/array/sizeof_variation4.phpt | 120 +++++++++--------- .../is_countable_with_variables.phpt | 2 +- 12 files changed, 164 insertions(+), 165 deletions(-) diff --git a/Zend/tests/generators/errors/count_error.phpt b/Zend/tests/generators/errors/count_error.phpt index 97e03e7d712d2..2eacfd0d359ea 100644 --- a/Zend/tests/generators/errors/count_error.phpt +++ b/Zend/tests/generators/errors/count_error.phpt @@ -15,4 +15,4 @@ try { ?> --EXPECTF-- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, Generator given in %s on line %d diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 7cffc44c73428..f57dc56cce706 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -8927,7 +8927,7 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED) } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 3076be79d5f3b..5e2174d1f2e42 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2281,7 +2281,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER( static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(uint32_t _arg_num, zval *_arg ZEND_OPCODE_HANDLER_ARGS_DC) { USE_OPLINE - zval *arg; char *func_name = get_function_or_method_name(EX(call)->func); const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); @@ -10576,7 +10575,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_ } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -17889,7 +17888,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -48254,7 +48253,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } diff --git a/ext/standard/array.c b/ext/standard/array.c index b8996f8a34288..55b4e629ebee8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -745,7 +745,7 @@ PHP_FUNCTION(count) switch (Z_TYPE_P(array)) { case IS_NULL: /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable"); + php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); RETURN_LONG(0); break; case IS_ARRAY: @@ -780,13 +780,13 @@ PHP_FUNCTION(count) /* If There's no handler and it doesn't implement Countable then add a warning */ /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable"); + php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); RETURN_LONG(1); break; } default: /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable"); + php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); RETURN_LONG(1); break; } diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 75819c7fb556b..d91ead10a1dca 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -63,11 +63,11 @@ function krsort(array &$array, int $sort_flags = SORT_REGULAR): bool {} function ksort(array &$array, int $sort_flags = SORT_REGULAR): bool {} -/** @param array|Countable|null $var */ +/** @param Countable|array $var */ function count($var, int $mode = COUNT_NORMAL): int {} /** - * @param array|object|null $var + * @param Countable|array $var * @alias count */ function sizeof($var, int $mode = COUNT_NORMAL): int {} diff --git a/ext/standard/tests/array/count_invalid.phpt b/ext/standard/tests/array/count_invalid.phpt index 95da00dac5100..4b146de85b933 100644 --- a/ext/standard/tests/array/count_invalid.phpt +++ b/ext/standard/tests/array/count_invalid.phpt @@ -23,20 +23,20 @@ var_dump($result); ?> --EXPECTF-- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, stdClass given in %s on line %d int(1) diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt index bae0fc94239b0..8532a74cb68ed 100644 --- a/ext/standard/tests/array/count_recursive.phpt +++ b/ext/standard/tests/array/count_recursive.phpt @@ -113,10 +113,10 @@ closedir( $resource2 ); *** Testing basic functionality of count() function *** -- Testing NULL -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d COUNT_NORMAL: should be 0, is 0 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d COUNT_RECURSIVE: should be 0, is 0 -- Testing arrays -- COUNT_NORMAL: should be 2, is 2 @@ -126,14 +126,14 @@ COUNT_NORMAL: should be 3, is 3 COUNT_RECURSIVE: should be 6, is 6 -- Testing strings -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_NORMAL: should be 1, is 1 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_RECURSIVE: should be 1, is 1 -- Testing various types with no second argument -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_NORMAL: should be 1, is 1 COUNT_NORMAL: should be 2, is 2 -- Testing really cool arrays -- @@ -175,18 +175,18 @@ COUNT_RECURSIVE is 7 -- Testing count() on constants with no second argument -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d COUNT_NORMAL: should be 1, is 1 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d COUNT_NORMAL: should be 1, is 1 -- Testing count() on NULL and Unset variables -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d COUNT_NORMAL: should be 0, is 0 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_NORMAL: should be 1, is 1 COUNT_NORMAL: should be 0, is 0 diff --git a/ext/standard/tests/array/sizeof_basic1.phpt b/ext/standard/tests/array/sizeof_basic1.phpt index 68dcc52a23efc..4c5910e3570e6 100644 --- a/ext/standard/tests/array/sizeof_basic1.phpt +++ b/ext/standard/tests/array/sizeof_basic1.phpt @@ -39,27 +39,27 @@ echo "Done"; *** Testing sizeof() : basic functionality *** -- Testing sizeof() for integer type in default, COUNT_NORMAL and COUNT_RECURSIVE modes -- default mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_NORMAL mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_RECURSIVE mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -- Testing sizeof() for float type in default, COUNT_NORMAL and COUNT_RECURSIVE modes -- default mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) Done diff --git a/ext/standard/tests/array/sizeof_object2.phpt b/ext/standard/tests/array/sizeof_object2.phpt index 513b239b129e1..9a96719eb68c0 100644 --- a/ext/standard/tests/array/sizeof_object2.phpt +++ b/ext/standard/tests/array/sizeof_object2.phpt @@ -95,67 +95,67 @@ echo "Done"; --- Testing sizeof() with objects which doesn't implement Countable interface --- -- Iteration 1 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d int(1) -- Iteration 2 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d int(1) -- Iteration 3 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d int(1) -- Iteration 4 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d int(1) -- Iteration 5 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d int(1) Done diff --git a/ext/standard/tests/array/sizeof_variation1.phpt b/ext/standard/tests/array/sizeof_variation1.phpt index 5f3988b8bd269..13196d3170edb 100644 --- a/ext/standard/tests/array/sizeof_variation1.phpt +++ b/ext/standard/tests/array/sizeof_variation1.phpt @@ -74,249 +74,249 @@ echo "Done"; --- Testing sizeof() for all scalar types in default,COUNT_NORMAL and COUNT_RECURSIVE mode --- -- Iteration 1 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -- Iteration 2 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -- Iteration 3 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 4 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 5 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 6 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 7 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 8 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 9 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 10 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 11 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 12 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 13 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 14 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 15 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 16 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 17 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 18 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 19 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d int(1) Done diff --git a/ext/standard/tests/array/sizeof_variation4.phpt b/ext/standard/tests/array/sizeof_variation4.phpt index e0c4b13eaa964..c8484d84512ca 100644 --- a/ext/standard/tests/array/sizeof_variation4.phpt +++ b/ext/standard/tests/array/sizeof_variation4.phpt @@ -84,380 +84,380 @@ echo "Done"; Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 2 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 3 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 4 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 5 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 6 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 7 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 8 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 9 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 10 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 11 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 12 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 13 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 14 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 15 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 16 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 17 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 18 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 19 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 20 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) Done diff --git a/ext/standard/tests/general_functions/is_countable_with_variables.phpt b/ext/standard/tests/general_functions/is_countable_with_variables.phpt index 0cb18769d64b8..7a4efc914b27d 100644 --- a/ext/standard/tests/general_functions/is_countable_with_variables.phpt +++ b/ext/standard/tests/general_functions/is_countable_with_variables.phpt @@ -25,4 +25,4 @@ bool(true) bool(false) int(2) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d