We can't simply use HASH_OF, need to use the usual hash table
getter.
if (other->ar_flags & SPL_ARRAY_IS_SELF) {
ZVAL_UNDEF(&intern->array);
} else if (Z_OBJ_HT_P(orig) == &spl_handler_ArrayObject) {
- ZVAL_ARR(&intern->array, zend_array_dup(HASH_OF(&other->array)));
+ ZVAL_ARR(&intern->array,
+ zend_array_dup(spl_array_get_hash_table(&other->array, 0)));
} else {
ZEND_ASSERT(Z_OBJ_HT_P(orig) == &spl_handler_ArrayIterator);
ZVAL_COPY(&intern->array, orig);
--- /dev/null
+--TEST--
+Clone ArrayObject using other with STD_PROP_LIST
+--FILE--
+<?php
+
+$a = new ArrayObject([1, 2, 3], ArrayObject::STD_PROP_LIST);
+$b = new ArrayObject($a);
+$c = clone $b;
+var_dump($c);
+
+?>
+--EXPECT--
+object(ArrayObject)#3 (1) {
+ ["storage":"ArrayObject":private]=>
+ array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ }
+}