xref: /PHP-7.2/ext/spl/tests/bug72051.phpt (revision 7648f20d)
1--TEST--
2Bug #72051 (The reference in CallbackFilterIterator doesn't work as expected)
3--FILE--
4<?php
5
6$data = [
7	[1,2]
8];
9
10$callbackTest = new CallbackFilterIterator(new ArrayIterator($data), function (&$current) {
11	$current['message'] = 'Test message';
12	return true;
13});
14
15$callbackTest->rewind();
16$data = $callbackTest->current();
17$callbackTest->next();
18print_r($data);
19?>
20--EXPECT--
21Array
22(
23    [0] => 1
24    [1] => 2
25    [message] => Test message
26)
27