-Catchable fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
+Catchable fatal error: Argument 1 passed to foo() must be an array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
Hi!
-Catchable fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+Catchable fatal error: Argument 1 passed to FooTest() must be an object of class Foo, none given, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, none given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, none given", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, null given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, null given", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
+ ce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
- char *error_msg;
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
error_msg = "implement interface";
} else {
error_msg = "be an instance of";
}
if (ptr && ptr->op_array) {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %s, instance of %s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, Z_OBJCE_P(arg)->name, ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %s", arg_num, fclass, fsep, fname, error_msg, ce->name);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %s, instance of %s given", arg_num, fclass, fsep, fname, error_msg, ce->name, Z_OBJCE_P(arg)->name);
}
return 0;
}
}
break;
- default:
+ default: {
+ ce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ if (ce->ce_flags & ZEND_ACC_INTERFACE) {
+ error_msg = "implement interface";
+ } else {
+ error_msg = "be an instance of";
+ }
if (ptr && ptr->op_array) {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %s, %s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, zend_zval_type_name(arg), ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %s, %s given", arg_num, fclass, fsep, fname, error_msg, ce->name, zend_zval_type_name(arg));
}
return 0;
+ }
}
} else if (cur_arg_info->array_type_hint) {
if (!arg) {
if (ptr && ptr->op_array) {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, none given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, none given", arg_num, fclass, fsep, fname);
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, null given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, null given", arg_num, fclass, fsep, fname);
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, %s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, zend_zval_type_name(arg), ptr->op_array->filename, ptr->opline->lineno);
} else {
- zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, %s given", arg_num, fclass, fsep, fname, zend_zval_type_name(arg));
-Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an object of class MyObject, called in %sinterfaces_003.php on line %d
+Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an object of class MyObject, none given, called in %sinterfaces_003.php on line %d
-Catchable fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, called in %s on line 27 and defined in %s on line 12
+Catchable fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s on line 12
-Catchable fatal error: Argument 1 passed to Test::f1() must be an array, called in %stype_hinting_003.php on line %d and defined in %stype_hinting_003.php on line %d
+Catchable fatal error: Argument 1 passed to Test::f1() must be an array, integer given, called in %stype_hinting_003.php on line %d and defined in %stype_hinting_003.php on line %d
-Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9
+Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, called in %s on line 16 and defined in %s on line 9