Fixed bug #74218 (ArrayIterator error message is confusing)

This commit is contained in:
Xinchen Hui 2017-03-10 15:15:31 +08:00
parent 9b16d4c999
commit c398198c0a
2 changed files with 2 additions and 2 deletions

View File

@ -1112,7 +1112,7 @@ static void spl_array_it_rewind(zend_object_iterator *iter) /* {{{ */
/* {{{ spl_array_set_array */
static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array) {
if (Z_TYPE_P(array) != IS_OBJECT && Z_TYPE_P(array) != IS_ARRAY) {
zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0);
zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object", 0);
return;
}

View File

@ -105,7 +105,7 @@ array(1) {
--> exchangeArray() with bad arg type:
Exception:Passed variable is not an array or object, using empty array instead
Exception:Passed variable is not an array or object
Notice: Undefined variable: copy in %s on line 46
object(ArrayObject)#3 (1) {