xref: /PHP-8.3/ext/spl/tests/iterator_035.phpt (revision e219ec14)
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 an array dimension of an object in %s:%d
18Stack trace:
19#0 {main}
20  thrown in %s on line %d
21