Does the information on this PHP wiki page help?
Specifically, to address your zend_hash_copy(obj->std.properties, &type->default_properties, (copy_ctor_func_t)zval_add_ref, (void *)&tmp, sizeof(zval *));
example, they suggest the following:
#if PHP_VERSION_ID < 50399
zend_hash_copy(tobj->std.properties, &(class_type->default_properties),
(copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*));
#else
object_properties_init(&tobj->std, class_type);
#endif