diff options
Diffstat (limited to 'ext/spl/tests/bug80719.phpt')
-rw-r--r-- | ext/spl/tests/bug80719.phpt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/spl/tests/bug80719.phpt b/ext/spl/tests/bug80719.phpt new file mode 100644 index 0000000000..506b250dae --- /dev/null +++ b/ext/spl/tests/bug80719.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #80719: Iterating after failed ArrayObject::setIteratorClass() causes Segmentation fault +--FILE-- +<?php + +$array = new ArrayObject([42]); +try { + $array->setIteratorClass(FilterIterator::class); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +foreach ($array as $v) { + var_dump($v); +} + +?> +--EXPECT-- +ArrayObject::setIteratorClass(): Argument #1 ($iteratorClass) must be a class name derived from ArrayIterator, FilterIterator given +int(42) |