xref: /PHP-7.2/ext/spl/tests/iterator_035.phpt (revision 17ccbeec)
1--TEST--
2SPL: ArrayIterator and values assigned by reference
3--FILE--
4<?php
5
6$tmp = 1;
7
8$a = new ArrayIterator();
9$a[] = $tmp;
10$a[] = &$tmp;
11
12echo "Done\n";
13?>
14--EXPECTF--
15Notice: Indirect modification of overloaded element of ArrayIterator has no effect in %s on line %d
16
17Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
18Stack trace:
19#0 {main}
20  thrown in %s on line %d
21