Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix parameter name in count() error message
This commit is contained in:
Nikita Popov 2021-07-29 14:25:22 +02:00
commit 9e66455fbc
6 changed files with 17 additions and 18 deletions

View file

@ -15,4 +15,4 @@ try {
?>
--EXPECT--
count(): Argument #1 ($var) must be of type Countable|array, Generator given
count(): Argument #1 ($value) must be of type Countable|array, Generator given

View file

@ -9042,7 +9042,7 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED)
ZVAL_UNDEFINED_OP1();
}
count = 0;
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));
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));
break;
}

View file

@ -10542,7 +10542,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_
ZVAL_UNDEFINED_OP1();
}
count = 0;
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));
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));
break;
}
@ -17797,7 +17797,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL
ZVAL_UNDEFINED_OP1();
}
count = 0;
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));
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));
break;
}
@ -47392,7 +47392,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z
ZVAL_UNDEFINED_OP1();
}
count = 0;
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));
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));
break;
}

View file

@ -47,10 +47,9 @@ try {
?>
--EXPECT--
count(): Argument #1 ($var) must be of type Countable|array, null given
count(): Argument #1 ($var) must be of type Countable|array, string given
count(): Argument #1 ($var) must be of type Countable|array, int given
count(): Argument #1 ($var) must be of type Countable|array, bool given
count(): Argument #1 ($var) must be of type Countable|array, bool given
count(): Argument #1 ($var) must be of type Countable|array, stdClass given
count(): Argument #1 ($value) must be of type Countable|array, null given
count(): Argument #1 ($value) must be of type Countable|array, string given
count(): Argument #1 ($value) must be of type Countable|array, int given
count(): Argument #1 ($value) must be of type Countable|array, bool given
count(): Argument #1 ($value) must be of type Countable|array, bool given
count(): Argument #1 ($value) must be of type Countable|array, stdClass given

View file

@ -103,23 +103,23 @@ echo "Done";
*** Testing sizeof() : object functionality ***
--- Testing sizeof() with objects which doesn't implement Countable interface ---
-- Iteration 1 --
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test given
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given
-- Iteration 2 --
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given
-- Iteration 3 --
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given
-- Iteration 4 --
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given
-- Iteration 5 --
Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given
Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given
Done

View file

@ -28,4 +28,4 @@ bool(true)
bool(true)
bool(false)
int(2)
count(): Argument #1 ($var) must be of type Countable|array, null given
count(): Argument #1 ($value) must be of type Countable|array, null given