Skip to content

Commit

Permalink
Fix bug #55416
Browse files Browse the repository at this point in the history
Remove extra, unnecessary warning when the callback fails for
array_map, array_reduce and array_filter
  • Loading branch information
morrisonlevi committed Jan 6, 2015
1 parent a26ecbd commit bb7ceb0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions ext/standard/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -4537,7 +4537,6 @@ PHP_FUNCTION(array_reduce)
} else {
zval_ptr_dtor(&args[1]);
zval_ptr_dtor(&args[0]);
php_error_docref(NULL, E_WARNING, "An error occurred while invoking the reduction callback");
return;
}
} ZEND_HASH_FOREACH_END();
Expand Down Expand Up @@ -4621,7 +4620,6 @@ PHP_FUNCTION(array_filter)
if (use_type == ARRAY_FILTER_USE_BOTH) {
zval_ptr_dtor(&args[1]);
}
php_error_docref(NULL, E_WARNING, "An error occurred while invoking the filter callback");
return;
}
} else if (!zend_is_true(operand)) {
Expand Down Expand Up @@ -4691,7 +4689,6 @@ PHP_FUNCTION(array_map)
ZVAL_COPY(&arg, zv);

if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback");
zval_dtor(return_value);
zval_ptr_dtor(&arg);
RETURN_NULL();
Expand Down Expand Up @@ -4779,7 +4776,6 @@ PHP_FUNCTION(array_map)
fci.no_separation = 0;

if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback");
efree(array_pos);
zval_dtor(return_value);
for (i = 0; i < n_arrays; i++) {
Expand Down
1 change: 0 additions & 1 deletion ext/standard/tests/array/array_map_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ try {
echo "Done\n";
?>
--EXPECTF--
Warning: array_map(): An error occurred while invoking the map callback in %s on line %d
string(17) "exception caught!"
Done
2 changes: 0 additions & 2 deletions ext/standard/tests/array/bug35821.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ echo "Done\n";
?>
--EXPECTF--

Warning: array_map(): An error occurred while invoking the map callback in %s on line %d

Fatal error: Uncaught exception 'Exception' in %s:%d
Stack trace:
#0 %s(%d): Element->ThrowException()
Expand Down

0 comments on commit bb7ceb0

Please sign in to comment.