unsigned gc:1;
};
-static inline int php_pq_object_read_prop_ex(zend_object *object, zend_string *member, int type, zval *return_value);
-
static int apply_pi_to_ht(zval *p, void *a)
{
zend_property_info *pi = Z_PTR_P(p);
} else {
zval tmp_prop, *property;
#if PHP_VERSION_ID < 80000
- zval zobj, zprop;
+ zval zobj;
ZVAL_OBJ(&zobj, &arg->pq_obj->zo);
- ZVAL_STR(&zprop, pi->name);
- property = php_pq_object_read_prop(&zobj, &zprop, BP_VAR_R, NULL, &tmp_prop);
+# if PHP_VERSION_ID < 70100
+ property = zend_read_property(arg->pq_obj->zo.ce, &zobj, pi->name->val, pi->name->len, 0, &tmp_prop);
+# else
+ property = zend_read_property_ex(arg->pq_obj->zo.ce, &zobj, pi->name, 0, &tmp_prop);
+# endif
#else
- property = php_pq_object_read_prop(&arg->pq_obj->zo, pi->name, BP_VAR_R, NULL, &tmp_prop);
+ property = zend_read_property_ex(arg->pq_obj->zo.ce, &arg->pq_obj->zo, pi->name, 0, &tmp_prop);
#endif
zend_hash_update(arg->ht, pi->name, property);
}
arg.ht = &arg.pq_obj->gc;
arg.gc = 1;
- zend_hash_clean(arg.ht);
- zend_hash_copy(arg.ht, props, NULL);
- zend_hash_apply_with_argument(&arg.pq_obj->zo.ce->properties_info, apply_pi_to_ht, &arg);
+ if (GC_REFCOUNT(arg.ht) == 1) {
+ zend_hash_clean(arg.ht);
+ zend_hash_copy(arg.ht, props, NULL);
+ zend_hash_apply_with_argument(&arg.pq_obj->zo.ce->properties_info, apply_pi_to_ht, &arg);
+ }
*table = NULL;
*n = 0;
return zend_std_read_property(object, member, type, cache_slot, tmp);
}
- tmp = zend_std_write_property(object, member, tmp, cache_slot);
+ zend_std_write_property(object, member, tmp, cache_slot);
+
if (cache_slot) {
*cache_slot = NULL;
}
if (SUCCESS != php_pq_object_read_prop_ex(Z_OBJ_P(object), member_str, type, tmp)) {
zend_string_release(member_str);
- return zend_std_read_property(object, member, type, cache_slot, tmp);
+ return zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, tmp);
}
zend_string_release(member_str);
-#if PHP_VERSON_ID >= 70400
- tmp =
-#endif
- zend_std_write_property(object, member, tmp, cache_slot);
+ zend_std_write_property(object, member, tmp, cache_slot);
+
if (cache_slot) {
*cache_slot = NULL;
}