zobj = Z_OBJ_P(obj);
- array_init(return_value);
+ array_init_size(return_value, zend_hash_num_elements(properties));
ZEND_HASH_FOREACH_STR_KEY_VAL_IND(properties, key, value) {
if (key) {
if (!new_object->properties) {
ALLOC_HASHTABLE(new_object->properties);
- zend_hash_init(new_object->properties, 8, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(new_object->properties, zend_hash_num_elements(old_object->properties), NULL, ZVAL_PTR_DTOR, 0);
}
ZEND_HASH_FOREACH_KEY_VAL(old_object->properties, num_key, key, prop) {
/* Merge equal constants */
j = 0; cache_slots = 0;
- zend_hash_init(&hash, 16, NULL, NULL, 0);
+ zend_hash_init(&hash, op_array->last_literal, NULL, NULL, 0);
map = (int*)zend_arena_alloc(&ctx->arena, op_array->last_literal * sizeof(int));
memset(map, 0, op_array->last_literal * sizeof(int));
for (i = 0; i < op_array->last_literal; i++) {