Skip to content

Commit bb7ceb0

Browse files
committed
Fix bug #55416
Remove extra, unnecessary warning when the callback fails for array_map, array_reduce and array_filter
1 parent a26ecbd commit bb7ceb0

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

ext/standard/array.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4537,7 +4537,6 @@ PHP_FUNCTION(array_reduce)
45374537
} else {
45384538
zval_ptr_dtor(&args[1]);
45394539
zval_ptr_dtor(&args[0]);
4540-
php_error_docref(NULL, E_WARNING, "An error occurred while invoking the reduction callback");
45414540
return;
45424541
}
45434542
} ZEND_HASH_FOREACH_END();
@@ -4621,7 +4620,6 @@ PHP_FUNCTION(array_filter)
46214620
if (use_type == ARRAY_FILTER_USE_BOTH) {
46224621
zval_ptr_dtor(&args[1]);
46234622
}
4624-
php_error_docref(NULL, E_WARNING, "An error occurred while invoking the filter callback");
46254623
return;
46264624
}
46274625
} else if (!zend_is_true(operand)) {
@@ -4691,7 +4689,6 @@ PHP_FUNCTION(array_map)
46914689
ZVAL_COPY(&arg, zv);
46924690

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

47814778
if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
4782-
php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback");
47834779
efree(array_pos);
47844780
zval_dtor(return_value);
47854781
for (i = 0; i < n_arrays; i++) {

ext/standard/tests/array/array_map_001.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ try {
1818
echo "Done\n";
1919
?>
2020
--EXPECTF--
21-
Warning: array_map(): An error occurred while invoking the map callback in %s on line %d
2221
string(17) "exception caught!"
2322
Done

ext/standard/tests/array/bug35821.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ echo "Done\n";
2323
?>
2424
--EXPECTF--
2525

26-
Warning: array_map(): An error occurred while invoking the map callback in %s on line %d
27-
2826
Fatal error: Uncaught exception 'Exception' in %s:%d
2927
Stack trace:
3028
#0 %s(%d): Element->ThrowException()

0 commit comments

Comments
 (0)