]> granicus.if.org Git - php/commitdiff
Don't verify arginfo types for internal functions
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 6 Jun 2019 11:05:11 +0000 (13:05 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 17 Jun 2019 09:46:28 +0000 (11:46 +0200)
To avoid duplicate type checks. In debug builds arginfo is still
checked and will generate an assertions if the function doesn't
subsequently throw an exception.

Some test results change due to differences in zpp and arginfo
error messages.

63 files changed:
UPGRADING.INTERNALS
Zend/zend_execute.c
Zend/zend_execute.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/date/tests/014.phpt
ext/date/tests/timezone_offset_get_error.phpt
ext/intl/tests/calendar_add_error.phpt
ext/intl/tests/calendar_before_after_error.phpt
ext/intl/tests/calendar_clear_error.phpt
ext/intl/tests/calendar_equals_error.phpt
ext/intl/tests/calendar_fieldDifference_error.phpt
ext/intl/tests/calendar_getDayOfWeekType_error.phpt
ext/intl/tests/calendar_getErrorCode_error.phpt
ext/intl/tests/calendar_getErrorMessage_error.phpt
ext/intl/tests/calendar_getFirstDayOfWeek_error.phpt
ext/intl/tests/calendar_getLocale_error.phpt
ext/intl/tests/calendar_getMinimalDaysInFirstWeek_error.phpt
ext/intl/tests/calendar_getSkipped_RepeatedWallTimeOption_error.phpt
ext/intl/tests/calendar_getTimeZone_error.phpt
ext/intl/tests/calendar_getTime_error.phpt
ext/intl/tests/calendar_getType_error.phpt
ext/intl/tests/calendar_getWeekendTransition_error.phpt
ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt
ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt
ext/intl/tests/calendar_inDaylightTime_error.phpt
ext/intl/tests/calendar_isEquivalentTo_error.phpt
ext/intl/tests/calendar_isLenient_error.phpt
ext/intl/tests/calendar_isSet_error.phpt
ext/intl/tests/calendar_isWeekend_error.phpt
ext/intl/tests/calendar_roll_error.phpt
ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt
ext/intl/tests/calendar_setLenient_error.phpt
ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt
ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt
ext/intl/tests/calendar_setTimeZone_error.phpt
ext/intl/tests/calendar_setTime_error.phpt
ext/intl/tests/calendar_set_error.phpt
ext/intl/tests/calendar_toDateTime_error.phpt
ext/intl/tests/gregoriancalendar_getGregorianChange_error.phpt
ext/intl/tests/gregoriancalendar_isLeapYear_error.phpt
ext/intl/tests/timezone_getDSTSavings_error.phpt
ext/intl/tests/timezone_getDisplayName_error.phpt
ext/intl/tests/timezone_getErrorCode_error.phpt
ext/intl/tests/timezone_getErrorMessage_error.phpt
ext/intl/tests/timezone_getID_error.phpt
ext/intl/tests/timezone_getOffset_error.phpt
ext/intl/tests/timezone_getRawOffset_error.phpt
ext/intl/tests/timezone_hasSameRules_error.phpt
ext/intl/tests/timezone_toDateTimeZone_error.phpt
ext/intl/tests/timezone_useDaylightTime_error.phpt
ext/intl/tests/transliterator_create_inverse_error.phpt
ext/intl/tests/transliterator_get_error_code_error.phpt
ext/intl/tests/transliterator_get_error_message_error.phpt
ext/opcache/jit/zend_jit_disasm_x86.c
ext/opcache/jit/zend_jit_helpers.c
ext/opcache/jit/zend_jit_x86.dasc
ext/reflection/tests/ReflectionClass_newInstanceArgs_002.phpt
ext/reflection/tests/ReflectionMethod_invokeArgs_error2.phpt
ext/spl/tests/CallbackFilterIteratorTest-002.phpt
ext/spl/tests/iterator_count.phpt
ext/spl/tests/iterator_to_array.phpt
ext/spl/tests/spl_004.phpt

index 2fa3a8d80d418a369e11998f94de2a9f0462ae78..2608c3cd62e080ebc3bc06c8836c25023edba7e5 100644 (file)
@@ -6,6 +6,7 @@ PHP 8.0 INTERNALS UPGRADE NOTES
   c. TSRM changes
   d. get() and set() object handlers
   e. zend_parse_parameters 'L' specifier
+  f. Arginfo argument types
 
 2. Build system changes
   a. Abstract
@@ -52,6 +53,10 @@ PHP 8.0 INTERNALS UPGRADE NOTES
      family of macros have been removed. Use 'l' and Z_PARAM_LONG() instead,
      which, despite the confusing name, actually have stricter input validation.
 
+  f. Arginfo argument types for internal functions are no longer checked.
+     Instead type checks should be performed using the zend_parse_parameters()
+     or ZEND_PARSE_PARAMETERS_*() APIs.
+
 ========================
 2. Build system changes
 ========================
index 06baae76e452eea3666fc3a673cd56be301af0d9..7a57a2c403d959b7c5927c01dcab94a3c74c3564 100644 (file)
@@ -888,6 +888,34 @@ static zend_bool zend_verify_weak_scalar_type_hint(zend_uchar type_hint, zval *a
        }
 }
 
+#if ZEND_DEBUG
+/* Used to sanity-check internal arginfo types without performing any actual type conversions. */
+static zend_bool zend_verify_weak_scalar_type_hint_no_sideeffect(zend_uchar type_hint, zval *arg)
+{
+       switch (type_hint) {
+               case _IS_BOOL: {
+                       zend_bool dest;
+                       return zend_parse_arg_bool_weak(arg, &dest);
+               }
+               case IS_LONG: {
+                       zend_long dest;
+                       return zend_parse_arg_long_weak(arg, &dest);
+               }
+               case IS_DOUBLE: {
+                       double dest;
+                       return zend_parse_arg_double_weak(arg, &dest);
+               }
+               case IS_STRING:
+                       /* We don't call cast_object here, because this check must be side-effect free. As this
+                        * is only used for a sanity check of arginfo/zpp consistency, it's okay if we accept
+                        * more than actually allowed here. */
+                       return Z_TYPE_P(arg) < IS_STRING || Z_TYPE_P(arg) == IS_OBJECT;
+               default:
+                       return 0;
+       }
+}
+#endif
+
 static zend_bool zend_verify_scalar_type_hint(zend_uchar type_hint, zval *arg, zend_bool strict, zend_bool is_internal_arg)
 {
        if (UNEXPECTED(strict)) {
@@ -903,6 +931,11 @@ static zend_bool zend_verify_scalar_type_hint(zend_uchar type_hint, zval *arg, z
                }
                return 0;
        }
+#if ZEND_DEBUG
+       if (is_internal_arg) {
+               return zend_verify_weak_scalar_type_hint_no_sideeffect(type_hint, arg);
+       }
+#endif
        return zend_verify_weak_scalar_type_hint(type_hint, arg);
 }
 
@@ -1083,7 +1116,7 @@ static zend_always_inline zend_bool zend_check_type(
         * because this case is already checked at compile-time. */
 }
 
-static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot, zend_bool is_internal)
+static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot)
 {
        zend_arg_info *cur_arg_info;
        zend_class_entry *ce;
@@ -1097,7 +1130,7 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
        }
 
        ce = NULL;
-       if (UNEXPECTED(!zend_check_type(cur_arg_info->type, arg, &ce, cache_slot, default_value, zf->common.scope, 0, is_internal))) {
+       if (UNEXPECTED(!zend_check_type(cur_arg_info->type, arg, &ce, cache_slot, default_value, zf->common.scope, 0, 0))) {
                zend_verify_arg_error(zf, cur_arg_info, arg_num, ce, arg);
                return 0;
        }
@@ -1140,21 +1173,29 @@ static zend_always_inline int zend_verify_variadic_arg_type(zend_function *zf, u
        return 1;
 }
 
-static zend_never_inline int zend_verify_internal_arg_types(zend_function *fbc, zend_execute_data *call)
+static zend_never_inline ZEND_ATTRIBUTE_UNUSED int zend_verify_internal_arg_types(zend_function *fbc, zend_execute_data *call)
 {
        uint32_t i;
        uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
-       zval *p = ZEND_CALL_ARG(call, 1);
-       void *dummy_cache_slot;
+       zval *arg = ZEND_CALL_ARG(call, 1);
 
        for (i = 0; i < num_args; ++i) {
-               dummy_cache_slot = NULL;
-               if (UNEXPECTED(!zend_verify_arg_type(fbc, i + 1, p, NULL, &dummy_cache_slot, 1))) {
-                       EG(current_execute_data) = call->prev_execute_data;
-                       zend_vm_stack_free_args(call);
+               zend_arg_info *cur_arg_info;
+               zend_class_entry *ce = NULL;
+               void *dummy_cache_slot = NULL;
+
+               if (EXPECTED(i < fbc->common.num_args)) {
+                       cur_arg_info = &fbc->common.arg_info[i];
+               } else if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_VARIADIC)) {
+                       cur_arg_info = &fbc->common.arg_info[fbc->common.num_args];
+               } else {
+                       break;
+               }
+
+               if (UNEXPECTED(!zend_check_type(cur_arg_info->type, arg, &ce, &dummy_cache_slot, NULL, fbc->common.scope, 0, /* is_internal_arg */ 1))) {
                        return 0;
                }
-               p++;
+               arg++;
        }
        return 1;
 }
@@ -4444,14 +4485,7 @@ ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode
        return ret;
 }
 
-ZEND_API void ZEND_FASTCALL zend_check_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg)
-{
-       void *dummy_cache_slot = NULL;
-
-       zend_verify_arg_type(zf, arg_num, arg, NULL, &dummy_cache_slot, 1);
-}
-
 ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot)
 {
-       return zend_verify_arg_type(zf, arg_num, arg, default_value, cache_slot, 0);
+       return zend_verify_arg_type(zf, arg_num, arg, default_value, cache_slot);
 }
index 6ef9baf252764a54d1ecc4bbd4d42bfcb00610fa..a77a909533b91375320d0862032f02cdf7001356 100644 (file)
@@ -52,7 +52,6 @@ ZEND_API int zend_eval_stringl_ex(const char *str, size_t str_len, zval *retval_
 /* export zend_pass_function to allow comparisons against it */
 extern ZEND_API const zend_internal_function zend_pass_function;
 
-ZEND_API void ZEND_FASTCALL zend_check_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg);
 ZEND_API int  ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot);
 ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data);
 
index d3052cf706e71848bc95746aebc70318a722bb1f..41c33be0df3a05471f0323b2f06e4061d828fb92 100644 (file)
@@ -3954,13 +3954,15 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL))
                call->prev_execute_data = execute_data;
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       zend_vm_stack_free_call_frame(call);
-                       zend_rethrow_exception(execute_data);
-                   UNDEF_RESULT();
-                       HANDLE_EXCEPTION();
-               }
+
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval;
                ZVAL_NULL(ret);
@@ -3969,6 +3971,7 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL))
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -4040,11 +4043,14 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL))
                call->prev_execute_data = execute_data;
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                 && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       UNDEF_RESULT();
-                       ZEND_VM_C_GOTO(fcall_end);
-               }
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval;
                ZVAL_NULL(ret);
@@ -4058,6 +4064,7 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL))
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -4073,7 +4080,6 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL))
                }
        }
 
-ZEND_VM_C_LABEL(fcall_end):
        if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) {
                OBJ_RELEASE(Z_OBJ(call->This));
        }
@@ -8108,14 +8114,14 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
 
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       zend_vm_stack_free_call_frame(call);
-                       if (ret) {
-                               ZVAL_UNDEF(ret);
-                       }
-                       ZEND_VM_C_GOTO(call_trampoline_end);
-               }
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                if (ret == NULL) {
                        ZVAL_NULL(&retval);
@@ -8131,6 +8137,7 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -8147,7 +8154,6 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
                }
        }
 
-ZEND_VM_C_LABEL(call_trampoline_end):
        execute_data = EG(current_execute_data);
 
        if (!EX(func) || !ZEND_USER_CODE(EX(func)->type) || (call_info & ZEND_CALL_TOP)) {
index 4b09ac05a3920e51ff38f7f8c5dad3811751d931..7a31d2685eb8ca5871c8f15d99e279e1e62d322d 100644 (file)
@@ -1129,13 +1129,15 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
                call->prev_execute_data = execute_data;
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       zend_vm_stack_free_call_frame(call);
-                       zend_rethrow_exception(execute_data);
-                   UNDEF_RESULT();
-                       HANDLE_EXCEPTION();
-               }
+
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                ret = 0 ? EX_VAR(opline->result.var) : &retval;
                ZVAL_NULL(ret);
@@ -1144,6 +1146,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -1205,13 +1208,15 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
                call->prev_execute_data = execute_data;
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       zend_vm_stack_free_call_frame(call);
-                       zend_rethrow_exception(execute_data);
-                   UNDEF_RESULT();
-                       HANDLE_EXCEPTION();
-               }
+
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                ret = 1 ? EX_VAR(opline->result.var) : &retval;
                ZVAL_NULL(ret);
@@ -1220,6 +1225,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -1291,11 +1297,14 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
                call->prev_execute_data = execute_data;
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                 && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       UNDEF_RESULT();
-                       goto fcall_end;
-               }
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                ret = 0 ? EX_VAR(opline->result.var) : &retval;
                ZVAL_NULL(ret);
@@ -1309,6 +1318,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -1324,7 +1334,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
                }
        }
 
-fcall_end:
        if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) {
                OBJ_RELEASE(Z_OBJ(call->This));
        }
@@ -1386,11 +1395,14 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
                call->prev_execute_data = execute_data;
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                 && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       UNDEF_RESULT();
-                       goto fcall_end;
-               }
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                ret = 1 ? EX_VAR(opline->result.var) : &retval;
                ZVAL_NULL(ret);
@@ -1404,6 +1416,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -1419,7 +1432,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
                }
        }
 
-fcall_end:
        if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) {
                OBJ_RELEASE(Z_OBJ(call->This));
        }
@@ -2418,14 +2430,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
 
                EG(current_execute_data) = call;
 
-               if (UNEXPECTED(fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)
-                && UNEXPECTED(!zend_verify_internal_arg_types(fbc, call))) {
-                       zend_vm_stack_free_call_frame(call);
-                       if (ret) {
-                               ZVAL_UNDEF(ret);
-                       }
-                       goto call_trampoline_end;
-               }
+#if ZEND_DEBUG
+               /* Type checks for internal functions are usually only performed by zpp.
+                * In debug mode we additionally run arginfo checks to detect cases where
+                * arginfo and zpp went out of sync. */
+               zend_bool wrong_arg_types =
+                       (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) &&
+                       !zend_verify_internal_arg_types(fbc, call);
+#endif
 
                if (ret == NULL) {
                        ZVAL_NULL(&retval);
@@ -2441,6 +2453,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
 
 #if ZEND_DEBUG
                if (!EG(exception) && call->func) {
+                       ZEND_ASSERT(!wrong_arg_types && "Arginfo / zpp type mismatch?");
                        ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
                                zend_verify_internal_return_type(call->func, ret));
                        ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)
@@ -2457,7 +2470,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
                }
        }
 
-call_trampoline_end:
        execute_data = EG(current_execute_data);
 
        if (!EX(func) || !ZEND_USER_CODE(EX(func)->type) || (call_info & ZEND_CALL_TOP)) {
index 5c1c061e756e663c5007f14bdf984331a3da7d7a..f57f3e4b1d811314c3db6c940666e7e05e5093bd 100644 (file)
@@ -33,7 +33,7 @@ object(DateTimeZone)#%d (2) {
 }
 int(0)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of DateTime given in %s:%d
+Fatal error: Uncaught TypeError: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s:%d
 Stack trace:
 #0 %s(%d): timezone_offset_get(Object(DateTime), Object(DateTimeZone))
 #1 {main}
index f77836c8ef8c9b6ef15c83b7c51636dbcdac6d5b..89687db4f2fc77f99659efeaac122805958be5f8 100644 (file)
@@ -62,22 +62,22 @@ try {
 }
 ?>
 ===DONE===
---EXPECTF--
+--EXPECT--
 *** Testing timezone_offset_get() : error conditions ***
 
 -- Testing timezone_offset_get() function with an invalid values for $object argument --
-string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of stdClass given"
+string(74) "timezone_offset_get() expects parameter 1 to be DateTimeZone, object given"
 
-string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, int given"
+string(71) "timezone_offset_get() expects parameter 1 to be DateTimeZone, int given"
 
-string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, null given"
+string(72) "timezone_offset_get() expects parameter 1 to be DateTimeZone, null given"
 
 
 -- Testing timezone_offset_get() function with an invalid values for $datetime argument --
-string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, instance of stdClass given"
+string(79) "timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given"
 
-string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, int given"
+string(76) "timezone_offset_get() expects parameter 2 to be DateTimeInterface, int given"
 
-string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given"
+string(77) "timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given"
 
 ===DONE===
index 1fc12828e13d09aca41665b7ceb3067dc88ea47e..f0fd43558ebe141c8c1de50633f3fae77b14f4be 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_add(1, 2, 3));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_add() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_add() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_add(1, 2, 3)
 #1 {main}
index 805f0648417a226ee6a4b5ed6e9a051cc986da9a..4d34ae77f5df55985729b226c3c88a474b487bb6 100644 (file)
@@ -65,9 +65,9 @@ error: 0, IntlCalendar::after() expects exactly 1 parameter, 0 given
 
 error: 0, IntlCalendar::before() expects exactly 1 parameter, 0 given
 
-error: 0, Argument 1 passed to IntlCalendar::after() must be an instance of IntlCalendar, int given
+error: 0, IntlCalendar::after() expects parameter 1 to be IntlCalendar, int given
 
-error: 0, Argument 1 passed to IntlCalendar::before() must be an instance of IntlCalendar, int given
+error: 0, IntlCalendar::before() expects parameter 1 to be IntlCalendar, int given
 
 error: 0, IntlCalendar::after() expects exactly 1 parameter, 2 given
 
index e91b7a6326aa6776f54ef889564b87adc6eea0e4..7fec27399e31f177f656d8f0816de6cd726e4e26 100644 (file)
@@ -23,7 +23,7 @@ bool(false)
 Warning: intlcal_clear(): intlcal_clear: invalid field in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_clear() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_clear() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_clear(1, 2)
 #1 {main}
index d716c1a698d33c491795fba61eb5568f4fa9b1b1..4e6f40b43d4c58b95be8f9a07f0a59488a9ec062 100644 (file)
@@ -47,10 +47,10 @@ try {
 --EXPECT--
 error: 0, IntlCalendar::equals() expects exactly 1 parameter, 0 given
 
-error: 0, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, instance of stdClass given
+error: 0, IntlCalendar::equals() expects parameter 1 to be IntlCalendar, object given
 
-error: 0, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, int given
+error: 0, IntlCalendar::equals() expects exactly 1 parameter, 2 given
 
-error: 0, Argument 2 passed to intlcal_equals() must be an instance of IntlCalendar, array given
+error: 0, intlcal_equals() expects parameter 2 to be IntlCalendar, array given
 
-error: 0, Argument 1 passed to intlcal_equals() must be an instance of IntlCalendar, int given
+error: 0, intlcal_equals() expects parameter 1 to be IntlCalendar, int given
index fa8860534874ec5d86ea3cd781d6a0d84e930ba9..1957dbbc2d739bad92b651ca881ac9e0c11e2afb 100644 (file)
@@ -32,7 +32,7 @@ Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU
 bool(false)
 intlcal_field_difference() expects exactly 3 parameters, 4 given
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_field_difference() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_field_difference() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_field_difference(1, 0, 1)
 #1 {main}
index 2722f540521f7a136c898104febf2bc98839094f..c138be81965a479e10ee607f304dede49605980c 100644 (file)
@@ -19,7 +19,7 @@ var_dump(intlcal_get_day_of_week_type(1, 1));
 Warning: IntlCalendar::getDayOfWeekType(): intlcal_get_day_of_week_type: invalid day of week in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_day_of_week_type() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_day_of_week_type() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_day_of_week_type(1, 1)
 #1 {main}
index 56e748fa129083d94bb190138f93a5912ef53815..9dafc0ed948cbac0e05d4202d8c0daafa71795d5 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_error_code(null));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_error_code() must be an instance of IntlCalendar, null given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_error_code() expects parameter 1 to be IntlCalendar, null given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_error_code(NULL)
 #1 {main}
index 8cdbb1f34b13bebbc146dfb710c9ce355387566e..abdfef45b67278e566abed1f454c479fcc09001e 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_error_message(null));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_error_message() must be an instance of IntlCalendar, null given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_error_message() expects parameter 1 to be IntlCalendar, null given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_error_message(NULL)
 #1 {main}
index 68e0fd9074842c7b742228c6ec8b9a579b82314f..f91e81dd694f867474041cecd81b160e15e10256 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_first_day_of_week(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_first_day_of_week() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_first_day_of_week() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_first_day_of_week(1)
 #1 {main}
index c033d82cf348968f8f570f81ba3bb96a45bcab26..90102a53f626de49ff4d749cf491d3e2c0eec3d4 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_locale(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_locale() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 parameters, 1 given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_locale(1)
 #1 {main}
index fe3825ad6846e3823cbd92b63ba855baa57e7c88..64e7530d9c94166a1e6b7dc50c0a84e8e5b38b64 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_minimal_days_in_first_week(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_minimal_days_in_first_week() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_minimal_days_in_first_week() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_minimal_days_in_first_week(1)
 #1 {main}
index 57eca0996e85aa87ef0746f92035b878611e3880..1e2b3f85dbb3e33e22b695deadb9b2f94180d014 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_skipped_wall_time_option(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_skipped_wall_time_option() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_skipped_wall_time_option() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_skipped_wall_time_option(1)
 #1 {main}
index f78d93f454a689e609b074d60bdd8c7c5aab2d7a..683d1e66ee014364233a6e7561b259c1664f5bf1 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_time_zone(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_time_zone() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_time_zone() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_time_zone(1)
 #1 {main}
index 51cb0cfe7e8bef03f0927a4213b52f6840fad89a..ca0924ee97e8e5f0fbacebff6cfdc6f7510ceeac 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_time(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_time() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_time() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_time(1)
 #1 {main}
index abc5f17fdd89971ef351743c39808362d47d5f7b..1c0e92b07fe57002b9c074f08e7c7c310b80641f 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_get_type(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_type() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_type() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_type(1)
 #1 {main}
index f6a4a71c18c143acc84e8fcb242d63004c6519a8..12bfbaa5fbae54ee7bce76ce18cc980db80d65b9 100644 (file)
@@ -18,7 +18,7 @@ var_dump(intlcal_get_weekend_transition(1, 1));
 Warning: IntlCalendar::getWeekendTransition(): intlcal_get_weekend_transition: invalid day of week in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_weekend_transition() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_get_weekend_transition() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_get_weekend_transition(1, 1)
 #1 {main}
index 9612862119118dcafc0099a5f0747b591d073de6..828f6a71d0b452c38a19554bb9894c5157eda5af 100644 (file)
@@ -71,10 +71,10 @@ bool(false)
 
 Warning: intlcal_get_minimum(): intlcal_get_minimum: invalid field in %s on line %d
 bool(false)
-error: 0, Argument 1 passed to intlcal_get_least_maximum() must be an instance of IntlCalendar, int given
+error: 0, intlcal_get_least_maximum() expects parameter 1 to be IntlCalendar, int given
 
-error: 0, Argument 1 passed to intlcal_get_maximum() must be an instance of IntlCalendar, int given
+error: 0, intlcal_get_maximum() expects parameter 1 to be IntlCalendar, int given
 
-error: 0, Argument 1 passed to intlcal_get_greatest_minimum() must be an instance of IntlCalendar, int given
+error: 0, intlcal_get_greatest_minimum() expects parameter 1 to be IntlCalendar, int given
 
-error: 0, Argument 1 passed to intlcal_get_minimum() must be an instance of IntlCalendar, int given
+error: 0, intlcal_get_minimum() expects parameter 1 to be IntlCalendar, int given
index 98408a4327259faf107da465c764938bea3182ac..22a4b859ab1b9098c3e97ad1290b7aca04c617f3 100644 (file)
@@ -99,8 +99,8 @@ error: 0, intlcal_get_actual_maximum() expects parameter 2 to be int, string giv
 
 error: 0, intlcal_get_actual_minimum() expects parameter 2 to be int, string given
 
-error: 0, Argument 1 passed to intlcal_get() must be an instance of IntlCalendar, int given
+error: 0, intlcal_get() expects exactly 2 parameters, 1 given
 
-error: 0, Argument 1 passed to intlcal_get_actual_maximum() must be an instance of IntlCalendar, int given
+error: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given
 
-error: 0, Argument 1 passed to intlcal_get_actual_minimum() must be an instance of IntlCalendar, int given
+error: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given
index bbcfcaabb1b5ce52f7e8771775ddc2a884203870..4eab7b2fe4e3f9512a17c9d74ce873b8e0573066 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_in_daylight_time(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_in_daylight_time() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_in_daylight_time() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_in_daylight_time(1)
 #1 {main}
index 254d1dab84639e14eef6bc570c6f3481b0a0a757..9faecdd7e109c3250dd4e2ab8b033a9805fb9db0 100644 (file)
@@ -49,14 +49,14 @@ try {
        echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
 }
 --EXPECT--
-error: 0, Argument 1 passed to IntlCalendar::isEquivalentTo() must be an instance of IntlCalendar, int given
+error: 0, IntlCalendar::isEquivalentTo() expects parameter 1 to be IntlCalendar, int given
 
 error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 parameter, 2 given
 
-error: 0, Argument 1 passed to IntlCalendar::isEquivalentTo() must be an instance of IntlCalendar, int given
+error: 0, IntlCalendar::isEquivalentTo() expects parameter 1 to be IntlCalendar, int given
 
 error: 0, intlcal_is_equivalent_to() expects exactly 2 parameters, 1 given
 
-error: 0, Argument 2 passed to intlcal_is_equivalent_to() must be an instance of IntlCalendar, int given
+error: 0, intlcal_is_equivalent_to() expects parameter 2 to be IntlCalendar, int given
 
-error: 0, Argument 1 passed to intlcal_is_equivalent_to() must be an instance of IntlCalendar, int given
+error: 0, intlcal_is_equivalent_to() expects parameter 1 to be IntlCalendar, int given
index 6fec30734990a072776f189c3549fb9bd949b7cd..4edbf70e559146ec475b75e745cc4d1335d4c33e 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_is_lenient(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_is_lenient() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_is_lenient() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_is_lenient(1)
 #1 {main}
index 9cb266f7422627bb3e7a4365f71b15c363bd8c63..169fb2dd431bcbb3bab838bec828497eef0cad97 100644 (file)
@@ -19,7 +19,7 @@ var_dump(intlcal_is_set(1, 2));
 Warning: IntlCalendar::isSet(): intlcal_is_set: invalid field in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_is_set() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_is_set() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_is_set(1, 2)
 #1 {main}
index de40b2aee691d070ecfeb30e53fef8117e632e20..0ed3e507b0396d8b39cbe31f41a7e40b590f7e91 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_is_weekend(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_is_weekend() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_is_weekend() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_is_weekend(1)
 #1 {main}
index bc00896d8b8f202b3199eff967acd363c1f695c2..b627e836173d71f954d27e5121dbaa5434705fb5 100644 (file)
@@ -19,7 +19,7 @@ var_dump(intlcal_roll(1, 2, 3));
 Warning: IntlCalendar::roll(): intlcal_roll: invalid field in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_roll() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_roll() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_roll(1, 2, 3)
 #1 {main}
index 6dcff918a782cbf6e70ca5909dc88daf98fd8aba..bb4e01ca000506ea7e327b0616cddc4c22666b1e 100644 (file)
@@ -23,7 +23,7 @@ bool(false)
 Warning: intlcal_set_first_day_of_week(): intlcal_set_first_day_of_week: invalid day of week in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_first_day_of_week() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_set_first_day_of_week() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_set_first_day_of_week(1, 2)
 #1 {main}
index 2d73857c2b404013f60ee69a8d996f5ad954f738..896b2e430a8b31a856ce73fb0370301d8acd7397 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_set_lenient(1, false));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_lenient() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_set_lenient() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_set_lenient(1, false)
 #1 {main}
index 430fc953bd759202b88c436ed975512c242e92aa..9bf3cb17dcae624f032b36d4c13cd91e9370248d 100644 (file)
@@ -23,7 +23,7 @@ bool(false)
 Warning: intlcal_set_minimal_days_in_first_week(): intlcal_set_minimal_days_in_first_week: invalid number of days; must be between 1 and 7 in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_minimal_days_in_first_week() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_set_minimal_days_in_first_week() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_set_minimal_days_in_first_week(1, 2)
 #1 {main}
index e3d03815dc9feda8ffc0575d39c3ec1ba136cf51..079517b29028c7b354ef4dd017f0e5b34aa00710 100644 (file)
@@ -23,7 +23,7 @@ bool(false)
 Warning: IntlCalendar::setRepeatedWallTimeOption(): intlcal_set_repeated_wall_time_option: invalid option in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_repeated_wall_time_option() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_set_repeated_wall_time_option() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_set_repeated_wall_time_option(1, 1)
 #1 {main}
index 1cace3b4eaa4436a6ac108685d7b036429140877..3f5e479e7957c6ac9b48f021209d3eb8834f213b 100644 (file)
@@ -47,4 +47,4 @@ error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 0 given
 
 error: 0, intlcal_set_time_zone() expects exactly 2 parameters, 3 given
 
-error: 0, Argument 1 passed to intlcal_set_time_zone() must be an instance of IntlCalendar, int given
+error: 0, intlcal_set_time_zone() expects parameter 1 to be IntlCalendar, int given
index 6ecbd698bf96dc70ccdd810bb64df6dbf24bdb15..0fb906bc2fa9d26333d0ae91b327b398166abb3c 100644 (file)
@@ -12,7 +12,7 @@ ini_set("intl.error_level", E_WARNING);
 
 var_dump(intlcal_set_time(1));
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_time() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught ArgumentCountError: intlcal_set_time() expects exactly 2 parameters, 1 given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_set_time(1)
 #1 {main}
index 2116786d322b0108599d06926e0d02589eb11c67..8f48c0f975397a6beee1d7b345450f6fd970f83d 100644 (file)
@@ -27,7 +27,7 @@ bool(false)
 Warning: intlcal_set(): intlcal_set: invalid field in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_set() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_set(1, 2, 3)
 #1 {main}
index e251c501b6084254c0cb440faf4c371b54468cce..ef799db61048f0c9c40eca0661b60d51cb20f42f 100644 (file)
@@ -21,7 +21,7 @@ var_dump(intlcal_to_date_time(3));
 Warning: IntlCalendar::toDateTime(): intlcal_to_date_time: DateTimeZone constructor threw exception in %s on line %d
 string(77) "exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_to_date_time() must be an instance of IntlCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlcal_to_date_time() expects parameter 1 to be IntlCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlcal_to_date_time(3)
 #1 {main}
index 3353690d1cc2c1dec42e9808f28beb1d6787aba5..37a0315c45fbe74cf8de3d7369f7a59851bce6a3 100644 (file)
@@ -14,7 +14,7 @@ var_dump(intlgregcal_get_gregorian_change(1));
 
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlgregcal_get_gregorian_change() must be an instance of IntlGregorianCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlgregcal_get_gregorian_change() expects parameter 1 to be IntlGregorianCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlgregcal_get_gregorian_change(1)
 #1 {main}
index 701e643e00d8fb92876311996ae6e084d90b990f..9b7c3e0be8d08304a4479432a86a6871e1215399 100644 (file)
@@ -14,7 +14,7 @@ var_dump(intlgregcal_is_leap_year(1, 2));
 
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intlgregcal_is_leap_year() must be an instance of IntlGregorianCalendar, int given in %s:%d
+Fatal error: Uncaught TypeError: intlgregcal_is_leap_year() expects parameter 1 to be IntlGregorianCalendar, int given in %s:%d
 Stack trace:
 #0 %s(%d): intlgregcal_is_leap_year(1, 2)
 #1 {main}
index ebb0eb7776a82f78c376c760d3aa4b09b0b1ffe8..c20da9021a470d52ca232e71d1ad0fa18331ef05 100644 (file)
@@ -11,7 +11,7 @@ ini_set("intl.error_level", E_WARNING);
 var_dump(intltz_get_dst_savings(null));
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_dst_savings() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_get_dst_savings() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_get_dst_savings(NULL)
 #1 {main}
index 108530d2c3fe720a13ada3f1c3da7cf67236a85a..7f8d913a17c13201d997fd818b213299a214b95e 100644 (file)
@@ -16,7 +16,7 @@ var_dump(intltz_get_display_name(null, IntlTimeZone::DISPLAY_SHORT, false, 'pt_P
 Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: wrong display type in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_display_name() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_get_display_name() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_get_display_name(NULL, 1, false, 'pt_PT')
 #1 {main}
index 657e09b240f63ec8d04ab3dcc1e3b106172775cd..5b4a59f17f5ff74aa16e6b7a3c6af2d8aef60f82 100644 (file)
@@ -11,7 +11,7 @@ ini_set("intl.error_level", E_WARNING);
 var_dump(intltz_get_error_code(null));
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_error_code() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_get_error_code() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_get_error_code(NULL)
 #1 {main}
index 3ea812050b85d7a7c524ed9f585a5335523fb771..ffceff358c2c651d81c6d2b3a8b87c4d7200ae52 100644 (file)
@@ -11,7 +11,7 @@ ini_set("intl.error_level", E_WARNING);
 var_dump(intltz_get_error_message(null));
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_error_message() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_get_error_message() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_get_error_message(NULL)
 #1 {main}
index 81d36b9d0b491fdcf1c1ce829b34cb5c69fefe03..1ba7d7482fe32edc811b6e7a0d76a4ec2e0b9643 100644 (file)
@@ -11,7 +11,7 @@ ini_set("intl.error_level", E_WARNING);
 intltz_get_id(null);
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_id() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_get_id() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_get_id(NULL)
 #1 {main}
index 3ae06e4ce0065a6aec5279015d564c3f165e78b7..95dc638adbc0cc692b7231e848db8a2fc39150bb 100644 (file)
@@ -17,7 +17,7 @@ intltz_get_offset(null, time()*1000, false, $a, $a);
 Warning: IntlTimeZone::getOffset(): intltz_get_offset: error obtaining offset in %s on line %d
 bool(false)
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_offset() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_get_offset() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_get_offset(NULL, %d, false, NULL, NULL)
 #1 {main}
index 9e0691f39d6e7ef8884cf4cdd0f750863ff29222..a16b62468b263256701c7eae788c04b940c14bf8 100644 (file)
@@ -11,7 +11,7 @@ ini_set("intl.error_level", E_WARNING);
 intltz_get_raw_offset(null);
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_raw_offset() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_get_raw_offset() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_get_raw_offset(NULL)
 #1 {main}
index 4ec73a96a6a54a76e16da6479c709ce350b48cf4..07aa15039ce2cacb83f4e4ac2fb53293487b53d3 100644 (file)
@@ -31,7 +31,7 @@ try {
 }
 --EXPECT--
 int(0)
-string(99) "Argument 1 passed to IntlTimeZone::hasSameRules() must be an instance of IntlTimeZone, string given"
+string(81) "IntlTimeZone::hasSameRules() expects parameter 1 to be IntlTimeZone, string given"
 
 int(0)
-string(92) "Argument 1 passed to intltz_has_same_rules() must be an instance of IntlTimeZone, null given"
+string(74) "intltz_has_same_rules() expects parameter 1 to be IntlTimeZone, null given"
index c402dec6736a324fb0fe60a436b1f1150b980d31..9df2bbf70d3b18b312904370b94eff575832a7d1 100644 (file)
@@ -21,7 +21,7 @@ var_dump(intltz_to_date_time_zone(1));
 Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: DateTimeZone constructor threw exception in %s on line %d
 string(66) "DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
 
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_to_date_time_zone() must be an instance of IntlTimeZone, int given in %s:%d
+Fatal error: Uncaught TypeError: intltz_to_date_time_zone() expects parameter 1 to be IntlTimeZone, int given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_to_date_time_zone(1)
 #1 {main}
index b872dcb18b8dba80ae6d3385fc7aab7a762fb42e..5b37cd16b14521e5f23d6e5e254f08070666f859 100644 (file)
@@ -11,7 +11,7 @@ ini_set("intl.error_level", E_WARNING);
 intltz_use_daylight_time(null);
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to intltz_use_daylight_time() must be an instance of IntlTimeZone, null given in %s:%d
+Fatal error: Uncaught TypeError: intltz_use_daylight_time() expects parameter 1 to be IntlTimeZone, null given in %s:%d
 Stack trace:
 #0 %s(%d): intltz_use_daylight_time(NULL)
 #1 {main}
index a7fffa62b1072e44e7b6f81d1c324bd87d65a339..c8d6bdc5a64edd4f383d62ce10b490400b0dd0fe 100644 (file)
@@ -10,7 +10,7 @@ ini_set("intl.error_level", E_WARNING);
 transliterator_create_inverse("jj");
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to transliterator_create_inverse() must be an instance of Transliterator, string given in %s:%d
+Fatal error: Uncaught TypeError: transliterator_create_inverse() expects parameter 1 to be Transliterator, string given in %s:%d
 Stack trace:
 #0 %s(%d): transliterator_create_inverse('jj')
 #1 {main}
index 813c8c480ef051e079d14436af59464798cf4f58..ed766fd968c591a14b534f9f530f10e5cbe00808 100644 (file)
@@ -8,7 +8,7 @@ ini_set("intl.error_level", E_WARNING);
 echo transliterator_get_error_code(array()), "\n";
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to transliterator_get_error_code() must be an instance of Transliterator, array given in %s:%d
+Fatal error: Uncaught TypeError: transliterator_get_error_code() expects parameter 1 to be Transliterator, array given in %s:%d
 Stack trace:
 #0 %s(%d): transliterator_get_error_code(Array)
 #1 {main}
index 7bcc7df169625df478ca8eb426af15eecc80c108..04746c7a5ff10d8ca7ac55082dbc562330ebd4b9 100644 (file)
@@ -8,7 +8,7 @@ ini_set("intl.error_level", E_WARNING);
 echo transliterator_get_error_message(array()), "\n";
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to transliterator_get_error_message() must be an instance of Transliterator, array given in %s:%d
+Fatal error: Uncaught TypeError: transliterator_get_error_message() expects parameter 1 to be Transliterator, array given in %s:%d
 Stack trace:
 #0 %s(%d): transliterator_get_error_message(Array)
 #1 {main}
index 396cad432f7ff03b2a475db6200bd366095bc46f..c7b7bf5814a617ed5ad1e62b8cf461b8ff2e6d5c 100644 (file)
@@ -433,7 +433,6 @@ static int zend_jit_disasm_init(void)
        REGISTER_HELPER(zend_jit_vm_stack_free_args_helper);
        REGISTER_HELPER(zend_jit_copy_extra_args_helper);
        REGISTER_HELPER(zend_jit_deprecated_or_abstract_helper);
-       REGISTER_HELPER(zend_jit_verify_internal_arg_types_helper);
        REGISTER_HELPER(zend_jit_assign_const_to_typed_ref);
        REGISTER_HELPER(zend_jit_assign_tmp_to_typed_ref);
        REGISTER_HELPER(zend_jit_assign_var_to_typed_ref);
index 98da0523b50073f05a1f356d5bd7623a94516ee2..cfad5786ac41d934c0865905bb640c8557ca0f1f 100644 (file)
@@ -1489,25 +1489,6 @@ static void ZEND_FASTCALL zend_jit_vm_stack_free_args_helper(zend_execute_data *
        zend_vm_stack_free_args(call);
 }
 
-static int ZEND_FASTCALL zend_jit_verify_internal_arg_types_helper(zend_execute_data *call)
-{
-       zend_function *fbc = call->func;
-       uint32_t i;
-       uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
-       zval *p = ZEND_CALL_ARG(call, 1);
-
-       for (i = 0; i < num_args; ++i) {
-               zend_check_internal_arg_type(fbc, i + 1, p);
-               if (UNEXPECTED(EG(exception))) {
-                       EG(current_execute_data) = call->prev_execute_data;
-                       zend_vm_stack_free_args(call);
-                       return 0;
-               }
-               p++;
-       }
-       return 1;
-}
-
 static zend_always_inline void zend_jit_assign_to_typed_ref(zend_reference *ref, zval *value, zend_uchar value_type)
 {
        zval variable;
index 4501edbc7a66266f7a430ae9e3a53d266f71f3ed..5023db62da2bc635c5fd50eb43d286635603ccf7 100644 (file)
@@ -7680,26 +7680,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, zend_op_ar
                |       // EG(current_execute_data) = execute_data;
                |       MEM_OP2_1_ZTS mov, aword, executor_globals, current_execute_data, RX, r1
 
-               if (!func || (func->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
-                       if (!func) {
-                               |       test dword [r0 + offsetof(zend_op_array, fn_flags)], ZEND_ACC_HAS_TYPE_HINTS
-                               |       jnz >1
-                               |.cold_code
-                       }
-                       |1:
-                       |       mov FCARG1a, RX
-                       |       EXT_CALL zend_jit_verify_internal_arg_types_helper, r0
-                       |       test r0, r0
-                       |       je >8
-                       |       LOAD_ZVAL_ADDR FCARG2a, res_addr // reload
-                       if (!func) {
-                               |       mov r0, EX:RX->func // reload
-                               |       jmp >1
-                               |.code
-                       }
-                       |1:
-               }
-
                zend_jit_reset_opline(Dst, NULL);
 
                |       // fbc->internal_function.handler(call, ret);
index bd27dfc17361b4c2052ade832f6d0289d848b986..de4fe65acef128754842ccb82c7c469d7c76a96e 100644 (file)
@@ -16,8 +16,8 @@ var_dump($a);
 
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to ReflectionClass::newInstanceArgs() must be of the type array, string given in %s:8
+Fatal error: Uncaught TypeError: ReflectionClass::newInstanceArgs() expects parameter 1 to be array, string given in %s:%d
 Stack trace:
 #0 %s(%d): ReflectionClass->newInstanceArgs('x')
 #1 {main}
-  thrown in %s on line 8
+  thrown in %s on line %d
index 6c81728f9123cc7aa5e2c558827769edbed49468..34e73c9a69be4fe98f4f458792585fdfe95cd274 100644 (file)
@@ -24,4 +24,4 @@ try {
 
 ?>
 --EXPECT--
-string(89) "Argument 2 passed to ReflectionMethod::invokeArgs() must be of the type array, bool given"
+string(74) "ReflectionMethod::invokeArgs() expects parameter 2 to be array, bool given"
index 6a05aa0aa2078eacabe701eaf33ac999009d78de..35795084729a2f4975b09029dc011df4f11f377c 100644 (file)
@@ -42,7 +42,7 @@ try {
 }
 --EXPECT--
 CallbackFilterIterator::__construct() expects exactly 2 parameters, 0 given
-Argument 1 passed to CallbackFilterIterator::__construct() must implement interface Iterator, null given
+CallbackFilterIterator::__construct() expects exactly 2 parameters, 1 given
 CallbackFilterIterator::__construct() expects parameter 2 to be a valid callback, no array or string given
 CallbackFilterIterator::__construct() expects parameter 2 to be a valid callback, array must have exactly two members
 some message
index 944b40dd961eb4fb5a8fbe3e2757240e438b0919..a115a7329cb607fc3f9d00575ca4b10a3fd13f6e 100644 (file)
@@ -13,7 +13,7 @@ iterator_count('1');
 
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to iterator_count() must implement interface Traversable, string given in %s:%d
+Fatal error: Uncaught TypeError: iterator_count() expects parameter 1 to be Traversable, string given in %s:%d
 Stack trace:
 #0 %s(%d): iterator_count('1')
 #1 {main}
index a5a8e5a9b7e33bdaaa124308779cac5e00c0da15..9225f03c00f07b140af311d2a4efc7385cb3026f 100644 (file)
@@ -13,7 +13,7 @@ iterator_to_array('test','test');
 
 ?>
 --EXPECTF--
-Fatal error: Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, string given in %s:%d
+Fatal error: Uncaught TypeError: iterator_to_array() expects parameter 1 to be Traversable, string given in %s:%d
 Stack trace:
 #0 %s(%d): iterator_to_array('test', 'test')
 #1 {main}
index 72458446e1c37d4513957eaffc445a8893ad10e4..857d5de685a1426eb6d31e544e7a5218443dcb6e 100644 (file)
@@ -86,7 +86,7 @@ int(5)
 int(6)
 int(4)
 ===ERRORS===
-Argument 3 passed to iterator_apply() must be of the type array or null, int given
+iterator_apply() expects parameter 3 to be array, int given
 iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_function' not found or invalid function name
 iterator_apply() expects at most 3 parameters, 4 given
 ===DONE===