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
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
========================
}
}
+#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)) {
}
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);
}
* 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;
}
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;
}
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;
}
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);
}
/* 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);
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);
#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)
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);
#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)
}
}
-ZEND_VM_C_LABEL(fcall_end):
if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) {
OBJ_RELEASE(Z_OBJ(call->This));
}
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);
#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)
}
}
-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)) {
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);
#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)
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);
#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)
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);
#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)
}
}
-fcall_end:
if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) {
OBJ_RELEASE(Z_OBJ(call->This));
}
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);
#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)
}
}
-fcall_end:
if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) {
OBJ_RELEASE(Z_OBJ(call->This));
}
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);
#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)
}
}
-call_trampoline_end:
execute_data = EG(current_execute_data);
if (!EX(func) || !ZEND_USER_CODE(EX(func)->type) || (call_info & ZEND_CALL_TOP)) {
}
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}
}
?>
===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===
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}
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
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}
--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
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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
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
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}
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
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}
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}
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}
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}
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}
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}
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}
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}
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
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}
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}
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}
?>
--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}
?>
--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}
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}
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}
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}
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}
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}
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}
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}
}
--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"
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}
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}
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}
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}
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}
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);
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;
| // 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);
?>
--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
?>
--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"
}
--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
?>
--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}
?>
--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}
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===