com php-src: Fix bug #55416: ext/standard/array.c ext/standard/ tests/array/array_map_001.phpt ext/standard/tests /array/bug35821.phpt
| From: | Levi Morrison | Date: | Tue, 06 Jan 2015 00:27:25 +0000 |
| Subject: | com php-src: Fix bug #55416: ext/standard/array.c ext/standard/ tests/array/array_map_001.phpt ext/standard/tests /array/bug35821.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84002@lists.php.net to get a copy of this message | ||
Commit: bb7ceb046eb5f0d5fa25066a3d7f9b4eb8cc3c93
Author: Levi Morrison <levim@php.net> Mon, 5 Jan 2015 17:27:25 -0700
Parents: a26ecbd5729d6a91d6ae54446c9ecf3392dffef8
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bb7ceb046eb5f0d5fa25066a3d7f9b4eb8cc3c93
Log:
Fix bug #55416
Remove extra, unnecessary warning when the callback fails for
array_map, array_reduce and array_filter
Bugs:
https://bugs.php.net/55416
Changed paths:
M ext/standard/array.c
M ext/standard/tests/array/array_map_001.phpt
M ext/standard/tests/array/bug35821.phpt
Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 86707f4..05098f5 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -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();
@@ -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)) {
@@ -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();
@@ -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++) {
diff --git a/ext/standard/tests/array/array_map_001.phpt
b/ext/standard/tests/array/array_map_001.phpt
index 646eb76..7d313b5 100644
--- a/ext/standard/tests/array/array_map_001.phpt
+++ b/ext/standard/tests/array/array_map_001.phpt
@@ -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
diff --git a/ext/standard/tests/array/bug35821.phpt b/ext/standard/tests/array/bug35821.phpt
index 05140d0..3411c34 100644
--- a/ext/standard/tests/array/bug35821.phpt
+++ b/ext/standard/tests/array/bug35821.phpt
@@ -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()