mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fixed bug #71153
This commit is contained in:
2
NEWS
2
NEWS
@@ -44,6 +44,8 @@ PHP NEWS
|
||||
- SPL:
|
||||
. Fixed bug #71077 (ReflectionMethod for ArrayObject constructor returns
|
||||
wrong number of parameters). (Laruence)
|
||||
. Fixed bug #71153 (Performance Degradation in ArrayIterator with large
|
||||
arrays). (Nikita)
|
||||
|
||||
17 Dec 2015, PHP 7.0.1
|
||||
|
||||
|
||||
@@ -130,6 +130,10 @@ static zend_always_inline uint32_t *spl_array_get_pos_ptr(HashTable *ht, spl_arr
|
||||
static void spl_array_object_free_storage(zend_object *object)
|
||||
{
|
||||
spl_array_object *intern = spl_array_from_obj(object);
|
||||
|
||||
if (intern->ht_iter != (uint32_t) -1) {
|
||||
zend_hash_iterator_del(intern->ht_iter);
|
||||
}
|
||||
|
||||
zend_object_std_dtor(&intern->std);
|
||||
|
||||
|
||||
16
ext/spl/tests/bug71153.phpt
Normal file
16
ext/spl/tests/bug71153.phpt
Normal file
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #71153: Performance Degradation in ArrayIterator with large arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = 200000;
|
||||
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
foreach (new ArrayIterator([]) as $v) {}
|
||||
}
|
||||
|
||||
echo "done\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
Reference in New Issue
Block a user