1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/gh8366.phpt
Christoph M. Becker 1762a87932 Fix GH-8366: ArrayIterator may leak when calling __construct()
When we detach an iterator, we also have to delete it.

Closes GH-8374.
2022-04-15 19:05:18 +02:00

10 lines
177 B
PHP

--TEST--
Bug GH-8366 (ArrayIterator may leak when calling __construct())
--FILE--
<?php
$it = new \ArrayIterator();
foreach ($it as $elt) {}
$it->__construct([]);
?>
--EXPECT--