static void ds_pair_unset_property(zval *object, zval *offset, void **cache_slot) { zval *property = get_property(Z_DS_PAIR_P(object), offset); if (property) { zval_ptr_dtor(property); ZVAL_NULL(property); } }
static zval *ds_pair_get_property_ptr_ptr(zval *object, zval *offset, int type, void **cache_slot) { zval *property = get_property(Z_DS_PAIR_P(object), offset); if ( ! property) { return &EG(uninitialized_zval); } return property; }
static zval *ds_pair_read_property(zval *object, zval *offset, int type, void **cache_slot, zval *rv) { zval *property = get_property(Z_DS_PAIR_P(object), offset); if ( ! property) { OFFSET_OUT_OF_BOUNDS(); return &EG(uninitialized_zval); } return property; }
static void ds_pair_write_property(zval *object, zval *offset, zval *value, void **cache_slot) { zval *property = get_property(Z_DS_PAIR_P(object), offset); if (property) { zval_ptr_dtor(property); ZVAL_COPY(property, value); return; } OFFSET_OUT_OF_BOUNDS(); }
static int ds_pair_has_property(zval *object, zval *offset, int has_set_exists, void **cache_slot) { zval *value = get_property(Z_DS_PAIR_P(object), offset); if ( ! value) { return 0; } // if (has_set_exists == 2) { return 1; } return ds_zval_isset(value, has_set_exists); }
static HashTable *ds_pair_get_debug_info(zval *object, int *is_temp) { zval arr; ds_pair_t *pair = Z_DS_PAIR_P(object); *is_temp = 1; array_init_size(&arr, 2); add_assoc_zval_ex(&arr, "key", 3, &pair->key); add_assoc_zval_ex(&arr, "value", 5, &pair->value); Z_TRY_ADDREF_P(&pair->key); Z_TRY_ADDREF_P(&pair->value); return Z_ARRVAL(arr); }
int php_ds_pair_serialize(zval *object, unsigned char **buffer, size_t *length, zend_serialize_data *data) { smart_str buf = {0}; ds_pair_t *pair = Z_DS_PAIR_P(object); php_serialize_data_t serialize_data = (php_serialize_data_t) data; PHP_VAR_SERIALIZE_INIT(serialize_data); php_var_serialize(&buf, &pair->key, &serialize_data); php_var_serialize(&buf, &pair->value, &serialize_data); smart_str_0(&buf); SERIALIZE_SET_ZSTR(buf.s); zend_string_release(buf.s); PHP_VAR_SERIALIZE_DESTROY(serialize_data); return SUCCESS; }
static int ds_pair_has_dimension(zval *object, zval *offset, int check_empty) { return ds_zval_isset(get_property(Z_DS_PAIR_P(object), offset), check_empty); }
static zend_object *ds_pair_clone_object(zval *object) { ds_pair_t *pair = Z_DS_PAIR_P(object); return php_ds_pair_create_clone(pair); }