xref: /PHP-7.0/ext/spl/tests/bug71028.phpt (revision 311eb2b1)
1--TEST--
2Bug #71028 (Undefined index with ArrayIterator)
3--FILE--
4<?php
5function cast(&$a) {
6		$a = (int)$a;
7}
8
9$a = new ArrayIterator;
10$a[-1] = 123;
11
12$b = "-1";
13cast($b);
14
15var_dump(isset($a[$b]));
16$a[$b] = "okey";
17var_dump($a[$b]);
18unset($a[$b]);
19var_dump(isset($a[$b]));
20?>
21--EXPECT--
22bool(true)
23string(4) "okey"
24bool(false)
25