X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fphp_pq_object.c;h=5b3f217a95f7e7bb4c9561a7d954a34359787089;hb=7074c710d3374eea1a81ed5ef5299f2d724c4497;hp=f84bb28adaba5c50ffdf620221c8966288224610;hpb=a3b5ed14b9166810f82cb4669529d7eaa5b88411;p=m6w6%2Fext-pq diff --git a/src/php_pq_object.c b/src/php_pq_object.c index f84bb28..5b3f217 100644 --- a/src/php_pq_object.c +++ b/src/php_pq_object.c @@ -103,7 +103,11 @@ static int apply_pi_to_ht(zval *p, void *a) zval zobj; ZVAL_OBJ(&zobj, &arg->pq_obj->zo); +# 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 = zend_read_property_ex(arg->pq_obj->zo.ce, &arg->pq_obj->zo, pi->name, 0, &tmp_prop); #endif @@ -172,9 +176,11 @@ static inline HashTable *php_pq_object_get_gc_ex(zend_object *object, HashTable 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; @@ -240,7 +246,7 @@ zval *php_pq_object_read_prop(zval *object, zval *member, int type, void **cache 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);