1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/spl/tests/bug80719.phpt
Nikita Popov 226395a335 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80719
2021-02-11 16:13:56 +01:00

20 lines
469 B
PHP

--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)