summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug80719.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/bug80719.phpt')
-rw-r--r--ext/spl/tests/bug80719.phpt15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/spl/tests/bug80719.phpt b/ext/spl/tests/bug80719.phpt
new file mode 100644
index 0000000000..66d83fad91
--- /dev/null
+++ b/ext/spl/tests/bug80719.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #80719: Iterating after failed ArrayObject::setIteratorClass() causes Segmentation fault
+--FILE--
+<?php
+
+$array = new ArrayObject([42]);
+$array->setIteratorClass(FilterIterator::class);
+foreach ($array as $v) {
+ var_dump($v);
+}
+
+?>
+--EXPECTF--
+Warning: ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from ArrayIterator, 'FilterIterator' given in %s on line %d
+int(42)