Skip to content

Commit 6c7b322

Browse files
committed
Fix parameter name in count() error message
This parameter has been renamed to $value.
1 parent 4645a9d commit 6c7b322

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

Zend/tests/generators/errors/count_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ try {
1515

1616
?>
1717
--EXPECT--
18-
count(): Argument #1 ($var) must be of type Countable|array, Generator given
18+
count(): Argument #1 ($value) must be of type Countable|array, Generator given

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8941,7 +8941,7 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED)
89418941
ZVAL_UNDEFINED_OP1();
89428942
}
89438943
count = 0;
8944-
zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
8944+
zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
89458945
break;
89468946
}
89478947

Zend/zend_vm_execute.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10357,7 +10357,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
1035710357
ZVAL_UNDEFINED_OP1();
1035810358
}
1035910359
count = 0;
10360-
zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
10360+
zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
1036110361
break;
1036210362
}
1036310363

@@ -17596,7 +17596,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
1759617596
ZVAL_UNDEFINED_OP1();
1759717597
}
1759817598
count = 0;
17599-
zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
17599+
zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
1760017600
break;
1760117601
}
1760217602

@@ -47073,7 +47073,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
4707347073
ZVAL_UNDEFINED_OP1();
4707447074
}
4707547075
count = 0;
47076-
zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
47076+
zend_type_error("%s(): Argument #1 ($value) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1));
4707747077
break;
4707847078
}
4707947079

ext/standard/tests/array/count_invalid.phpt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ try {
4747

4848
?>
4949
--EXPECT--
50-
count(): Argument #1 ($var) must be of type Countable|array, null given
51-
count(): Argument #1 ($var) must be of type Countable|array, string given
52-
count(): Argument #1 ($var) must be of type Countable|array, int given
53-
count(): Argument #1 ($var) must be of type Countable|array, bool given
54-
count(): Argument #1 ($var) must be of type Countable|array, bool given
55-
count(): Argument #1 ($var) must be of type Countable|array, stdClass given
56-
50+
count(): Argument #1 ($value) must be of type Countable|array, null given
51+
count(): Argument #1 ($value) must be of type Countable|array, string given
52+
count(): Argument #1 ($value) must be of type Countable|array, int given
53+
count(): Argument #1 ($value) must be of type Countable|array, bool given
54+
count(): Argument #1 ($value) must be of type Countable|array, bool given
55+
count(): Argument #1 ($value) must be of type Countable|array, stdClass given

ext/standard/tests/array/sizeof_object2.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,23 @@ echo "Done";
103103
*** Testing sizeof() : object functionality ***
104104
--- Testing sizeof() with objects which doesn't implement Countable interface ---
105105
-- Iteration 1 --
106-
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test given
106+
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
107107
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
108108
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
109109
-- Iteration 2 --
110-
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given
110+
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
111111
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
112112
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
113113
-- Iteration 3 --
114-
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given
114+
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
115115
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
116116
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
117117
-- Iteration 4 --
118-
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given
118+
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
119119
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
120120
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
121121
-- Iteration 5 --
122-
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given
122+
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
123123
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
124124
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
125125
Done

ext/standard/tests/general_functions/is_countable_with_variables.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ bool(true)
2828
bool(true)
2929
bool(false)
3030
int(2)
31-
count(): Argument #1 ($var) must be of type Countable|array, null given
31+
count(): Argument #1 ($value) must be of type Countable|array, null given

0 commit comments

Comments
 (0)