summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/spl/spl_iterators.c6
-rw-r--r--ext/spl/tests/bug72051.phpt4
2 files changed, 3 insertions, 7 deletions
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 1656ef1f77..9e4ed5036f 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -1785,7 +1785,7 @@ PHP_METHOD(CallbackFilterIterator, accept)
fci->retval = return_value;
fci->param_count = 3;
fci->params = params;
- fci->no_separation = 0;
+ fci->no_separation = 1;
if (zend_call_function(fci, fcc) != SUCCESS || Z_ISUNDEF_P(return_value)) {
RETURN_FALSE;
@@ -1794,10 +1794,6 @@ PHP_METHOD(CallbackFilterIterator, accept)
if (EG(exception)) {
RETURN_THROWS();
}
-
- /* zend_call_function may change args to IS_REF */
- ZVAL_COPY_VALUE(&intern->current.data, &params[0]);
- ZVAL_COPY_VALUE(&intern->current.key, &params[1]);
}
/* }}} */
diff --git a/ext/spl/tests/bug72051.phpt b/ext/spl/tests/bug72051.phpt
index b0fe05169a..42cc1ea833 100644
--- a/ext/spl/tests/bug72051.phpt
+++ b/ext/spl/tests/bug72051.phpt
@@ -17,10 +17,10 @@ $data = $callbackTest->current();
$callbackTest->next();
print_r($data);
?>
---EXPECT--
+--EXPECTF--
+Warning: {closure}(): Argument #1 ($current) must be passed by reference, value given in %s on line %d
Array
(
[0] => 1
[1] => 2
- [message] => Test message
)