summaryrefslogtreecommitdiff
path: root/Zend/tests/bug76901.phpt
blob: 8d567d9e0cbe1b3b554fa16f17bfdf21437f9ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
Bug #76901: method_exists on SPL iterator passthrough method corrupts memory
--FILE--
<?php

$it = new ArrayIterator([1, 2, 3]);
$it = new IteratorIterator($it);
foreach ($it as $v) {
    if (method_exists($it, 'offsetGet')) {
        var_dump($it->offsetGet(0));
    }
}

?>
--EXPECT--
int(1)
int(1)
int(1)