xref: /PHP-8.4/ext/spl/tests/iterator_049b.phpt (revision ea256a21)
1--TEST--
2SPL: ArrayIterator with NULL key
3--FILE--
4<?php
5
6$ar = new ArrayIterator(array(
7    NULL=>1,
8    "\0"=>2,
9    "\0\0"=>3,
10    "\0\0\0"=>4,
11    "\0*"=>5,
12    "\0*\0"=>6,
13    ));
14@var_dump($ar);
15var_dump($ar->getArrayCopy());
16
17?>
18--EXPECTF--
19object(ArrayIterator)#%d (1) {
20  ["storage":"ArrayIterator":private]=>
21  array(6) {
22    [""]=>
23    int(1)
24    ["%0"]=>
25    int(2)
26    ["%0%0"]=>
27    int(3)
28    ["%0%0%0"]=>
29    int(4)
30    ["%0*"]=>
31    int(5)
32    ["%0*%0"]=>
33    int(6)
34  }
35}
36array(6) {
37  [""]=>
38  int(1)
39  ["%0"]=>
40  int(2)
41  ["%0%0"]=>
42  int(3)
43  ["%0%0%0"]=>
44  int(4)
45  ["%0*"]=>
46  int(5)
47  ["%0*%0"]=>
48  int(6)
49}
50