mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02: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:
parent
a04d181578
commit
c77bbcd464
2 changed files with 15 additions and 0 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue