Indicate entry is skipped in error message

This commit is contained in:
George Peter Banyard 2019-09-01 01:34:55 +02:00
parent 0b4e007253
commit f816171240
4 changed files with 20 additions and 20 deletions

View File

@ -4109,7 +4109,7 @@ PHP_FUNCTION(array_count_values)
Z_LVAL_P(tmp)++;
}
} else {
php_error_docref(NULL, E_WARNING, "Can only count STRING and INTEGER values!");
php_error_docref(NULL, E_WARNING, "Can only count string and integer values, entry skipped");
}
} ZEND_HASH_FOREACH_END();
}
@ -4452,7 +4452,7 @@ PHP_FUNCTION(array_flip)
}
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(entry), &data);
} else {
php_error_docref(NULL, E_WARNING, "Can only flip STRING and INTEGER values!");
php_error_docref(NULL, E_WARNING, "Can only flip string and integer values, entry skipped");
}
} ZEND_HASH_FOREACH_END();
}

View File

@ -18,11 +18,11 @@ $array1 = array(1,
var_dump(array_count_values($array1));
?>
--EXPECTF--
Warning: array_count_values(): Can only count STRING and INTEGER values! in %s on line %d
Warning: array_count_values(): Can only count string and integer values, entry skipped in %s on line %d
Warning: array_count_values(): Can only count STRING and INTEGER values! in %s on line %d
Warning: array_count_values(): Can only count string and integer values, entry skipped in %s on line %d
Warning: array_count_values(): Can only count STRING and INTEGER values! in %s on line %d
Warning: array_count_values(): Can only count string and integer values, entry skipped in %s on line %d
array(8) {
[1]=>
int(2)

View File

@ -16,11 +16,11 @@ $trans = array_flip($trans);
var_dump($trans);
?>
--EXPECTF--
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
array(6) {
[1]=>
string(1) "b"

View File

@ -62,29 +62,29 @@ echo "Done"
--EXPECTF--
*** Testing array_flip() : different invalid values in 'input' array argument ***
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
Warning: array_flip(): Can only flip string and integer values, entry skipped in %s on line %d
array(0) {
}
Done