Skip to content

Commit 56c18c4

Browse files
committed
Drop unneessary if branch and adjust arg_num type
This if branch seems to be a remain of when certain type errors where E_WARNINGs, something which isn't the case since PHP 8.0.
1 parent 6c89359 commit 56c18c4

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

Zend/zend_execute.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -685,19 +685,13 @@ static ZEND_COLD void zend_verify_type_error_common(
685685
}
686686

687687
ZEND_API ZEND_COLD void zend_verify_arg_error(
688-
const zend_function *zf, const zend_arg_info *arg_info, int arg_num, zval *value)
688+
const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *value)
689689
{
690690
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
691691
const char *fname, *fsep, *fclass;
692692
zend_string *need_msg;
693693
const char *given_msg;
694694

695-
if (EG(exception)) {
696-
/* The type verification itself might have already thrown an exception
697-
* through a promoted warning. */
698-
return;
699-
}
700-
701695
zend_verify_type_error_common(
702696
zf, arg_info, value, &fname, &fsep, &fclass, &need_msg, &given_msg);
703697

Zend/zend_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_index_write(HashTabl
7070

7171
ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg);
7272
ZEND_API ZEND_COLD void zend_verify_arg_error(
73-
const zend_function *zf, const zend_arg_info *arg_info, int arg_num, zval *value);
73+
const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, zval *value);
7474
ZEND_API ZEND_COLD void zend_verify_return_error(
7575
const zend_function *zf, zval *value);
7676
ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref);

0 commit comments

Comments
 (0)