mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Fixed GH-8041 (php 8.2.0-dev crashes with assertion for cloning/get_object_vars on non-empty SplFixedArray)
This commit is contained in:
@@ -223,6 +223,10 @@ static HashTable* spl_fixedarray_object_get_properties(zend_object *obj)
|
||||
zend_hash_index_del(ht, i);
|
||||
}
|
||||
}
|
||||
if (HT_IS_PACKED(ht)) {
|
||||
/* Engine doesn't expet packed array */
|
||||
zend_hash_packed_to_hash(ht);
|
||||
}
|
||||
}
|
||||
|
||||
return ht;
|
||||
|
||||
11
ext/spl/tests/fixedarray_023.phpt
Normal file
11
ext/spl/tests/fixedarray_023.phpt
Normal file
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
SPL: FixedArray: Bug GH-8041 (php 8.2.0-dev crashes with assertion for cloning/get_object_vars on non-empty SplFixedArray)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = new SplFixedArray(1);
|
||||
$z = (array)$x;
|
||||
$y = clone $x;
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
Reference in New Issue
Block a user