xref: /PHP-7.4/ext/spl/tests/bug80719.phpt (revision c34c5234)
1--TEST--
2Bug #80719: Iterating after failed ArrayObject::setIteratorClass() causes Segmentation fault
3--FILE--
4<?php
5
6$array = new ArrayObject([42]);
7$array->setIteratorClass(FilterIterator::class);
8foreach ($array as $v) {
9    var_dump($v);
10}
11
12?>
13--EXPECTF--
14Warning: ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from ArrayIterator, 'FilterIterator' given in %s on line %d
15int(42)
16