Skip to content

Commit e85604f

Browse files
jmikoladerickr
authored andcommitted
PHPC-405: Additional zval* to zval changes
1 parent 3ce6205 commit e85604f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/BSON/Javascript.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,13 @@ HashTable *php_phongo_javascript_get_debug_info(zval *object, int *is_temp TSRML
159159
php_phongo_bson_state state = PHONGO_BSON_STATE_INITIALIZER;
160160

161161
if (bson_to_zval_ex(bson_get_data(intern->document), intern->document->len, &state)) {
162+
#if PHP_VERSION_ID >= 70000
163+
Z_ADDREF(state.zchild);
164+
ADD_ASSOC_ZVAL_EX(&retval, "scope", &state.zchild);
165+
#else
162166
Z_ADDREF_P(state.zchild);
163-
add_assoc_zval_ex(&retval, ZEND_STRS("scope"), state.zchild);
167+
ADD_ASSOC_ZVAL_EX(&retval, "scope", state.zchild);
168+
#endif
164169
} else {
165170
ADD_ASSOC_NULL_EX(&retval, "scope");
166171
}

src/MongoDB/ReadPreference.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ PHP_METHOD(ReadPreference, getTagSets)
132132
state.map.document_type = PHONGO_TYPEMAP_NATIVE_ARRAY;
133133

134134
bson_to_zval_ex(bson_get_data(&intern->read_preference->tags), intern->read_preference->tags.len, &state);
135+
#if PHP_VERSION_ID >= 70000
136+
RETURN_ZVAL(&state.zchild, 0, 1);
137+
#else
135138
RETURN_ZVAL(state.zchild, 0, 1);
139+
#endif
136140
} else {
137141
RETURN_NULL();
138142
}

0 commit comments

Comments
 (0)