bug76901.phpt 317 B

123456789101112131415161718
  1. --TEST--
  2. Bug #76901: method_exists on SPL iterator passthrough method corrupts memory
  3. --FILE--
  4. <?php
  5. $it = new ArrayIterator([1, 2, 3]);
  6. $it = new IteratorIterator($it);
  7. foreach ($it as $v) {
  8. if (method_exists($it, 'offsetGet')) {
  9. var_dump($it->offsetGet(0));
  10. }
  11. }
  12. ?>
  13. --EXPECT--
  14. int(1)
  15. int(1)
  16. int(1)