Skip to content

Indicate entry is skipped in error message for array_fill and array_count_values #4661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/standard/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -4106,7 +4106,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();
}
Expand Down Expand Up @@ -4449,7 +4449,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();
}
Expand Down
6 changes: 3 additions & 3 deletions ext/standard/tests/array/array_count_values2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions ext/standard/tests/array/array_flip.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions ext/standard/tests/array/array_flip_variation4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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