summaryrefslogtreecommitdiff
path: root/ext/spl/tests/array_028.phpt
blob: 1adcdd3f90714c010a9c06264825e83096a0118c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
ArrayObject/Iterator on array with NUL bytes
--FILE--
<?php
$array = [
    "\0foo" => "bar",
];

$it = new ArrayIterator($array);
foreach ($it as $v) {
    var_dump($v);
}

$obj = new ArrayObject($array);
foreach ($obj as $v) {
    var_dump($v);
}

$obj = new ArrayObject($it);
foreach ($obj as $v) {
    var_dump($v);
}
?>
--EXPECT--
string(3) "bar"
string(3) "bar"
string(3) "bar"