1
0
mirror of https://github.com/danog/ext-pq.git synced 2024-11-26 11:54:50 +01:00

restore PHP 7 compatibility

This commit is contained in:
Michael Wallner 2020-09-24 11:09:31 +02:00
parent a3b5ed14b9
commit f33cb66938
No known key found for this signature in database
GPG Key ID: 480E3E14B0A4C7C7
2 changed files with 4 additions and 5 deletions

View File

@ -90,9 +90,6 @@ extern HashTable *php_pq_parse_array(php_pqres_t *res, const char *val_str, size
#define php_pq_cast_object(objval_ptr, cast_type, retval_ptr) \
(Z_OBJ_HT_P(objval_ptr)->cast_object && \
SUCCESS == Z_OBJ_HT_P(objval_ptr)->cast_object(objval_ptr, (retval_ptr), (cast_type)))
# if PHP_VERSION_ID <= 70200
zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
# endif
#endif

View File

@ -104,8 +104,10 @@ static int apply_pi_to_ht(zval *p, void *a)
ZVAL_OBJ(&zobj, &arg->pq_obj->zo);
property = zend_read_property_ex(arg->pq_obj->zo.ce, &zobj, pi->name, 0, &tmp_prop);
#else
#elif PHP_VERSION_ID >= 70100
property = zend_read_property_ex(arg->pq_obj->zo.ce, &arg->pq_obj->zo, pi->name, 0, &tmp_prop);
#else
property = zend_read_property(arg->pq_obj->zo.ce, &arg->pq_obj->zo, pi->name->val, pi->name->len, 0, &tmp_prop);
#endif
zend_hash_update(arg->ht, pi->name, property);
}
@ -240,7 +242,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);