Skip to content

Commit 4e74331

Browse files
committed
Merge pull request #645
2 parents 4277d7b + 3d4ac22 commit 4e74331

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

src/bson.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,15 +807,15 @@ bool php_phongo_bson_visit_document(const bson_iter_t *iter ARG_UNUSED, const ch
807807
case PHONGO_TYPEMAP_NATIVE_OBJECT:
808808
default:
809809
#if PHP_VERSION_ID >= 70000
810-
object_and_properties_init(&state.zchild, zend_standard_class_def, Z_ARRVAL(state.zchild));
810+
convert_to_object(&state.zchild);
811811
if (((php_phongo_bson_state *)data)->is_visiting_array) {
812812
add_next_index_zval(retval, &state.zchild);
813813
} else {
814814
ADD_ASSOC_ZVAL(retval, key, &state.zchild);
815815
}
816816
Z_SET_REFCOUNT(state.zchild, 1);
817817
#else
818-
object_and_properties_init(state.zchild, zend_standard_class_def, Z_ARRVAL_P(state.zchild));
818+
convert_to_object(state.zchild);
819819
if (((php_phongo_bson_state *)data)->is_visiting_array) {
820820
add_next_index_zval(retval, state.zchild);
821821
} else {
@@ -898,15 +898,15 @@ bool php_phongo_bson_visit_array(const bson_iter_t *iter ARG_UNUSED, const char
898898

899899
case PHONGO_TYPEMAP_NATIVE_OBJECT:
900900
#if PHP_VERSION_ID >= 70000
901-
object_and_properties_init(&state.zchild, zend_standard_class_def, Z_ARRVAL(state.zchild));
901+
convert_to_object(&state.zchild);
902902
if (((php_phongo_bson_state *)data)->is_visiting_array) {
903903
add_next_index_zval(retval, &state.zchild);
904904
} else {
905905
ADD_ASSOC_ZVAL(retval, key, &state.zchild);
906906
}
907907
Z_SET_REFCOUNT(state.zchild, 1);
908908
#else
909-
object_and_properties_init(state.zchild, zend_standard_class_def, Z_ARRVAL_P(state.zchild));
909+
convert_to_object(state.zchild);
910910
if (((php_phongo_bson_state *)data)->is_visiting_array) {
911911
add_next_index_zval(retval, state.zchild);
912912
} else {
@@ -1587,9 +1587,9 @@ int phongo_bson_to_zval_ex(const unsigned char *data, int data_len, php_phongo_b
15871587
case PHONGO_TYPEMAP_NATIVE_OBJECT:
15881588
default:
15891589
#if PHP_VERSION_ID >= 70000
1590-
object_and_properties_init(&state->zchild, zend_standard_class_def, Z_ARRVAL(state->zchild));
1590+
convert_to_object(&state->zchild);
15911591
#else
1592-
object_and_properties_init(state->zchild, zend_standard_class_def, Z_ARRVAL_P(state->zchild));
1592+
convert_to_object(state->zchild);
15931593
#endif
15941594
}
15951595

tests/bson/bson-encode-004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Test { "0" : { "__pclass" : { "$binary" : "UGVyc29u", "$type" : "80" }, "name" :
9494
110 : 00 04 66 72 69 65 6e 64 73 00 05 00 00 00 00 00 [..friends.......]
9595
120 : 00 00 00 [...]
9696
object(stdClass)#%d (1) {
97-
[0]=>
97+
[%r(0|"0")%r]=>
9898
object(Person)#%d (5) {
9999
["name":protected]=>
100100
string(6) "Hannes"

tests/bson/bson-toPHP-004.phpt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object(stdClass)#%d (1) {
6767
object(stdClass)#%d (1) {
6868
["x"]=>
6969
object(stdClass)#%d (1) {
70-
[0]=>
70+
[%r(0|"0")%r]=>
7171
NULL
7272
}
7373
}
@@ -93,7 +93,7 @@ object(stdClass)#%d (1) {
9393
object(stdClass)#%d (1) {
9494
["x"]=>
9595
object(stdClass)#%d (1) {
96-
[0]=>
96+
[%r(0|"0")%r]=>
9797
bool(true)
9898
}
9999
}
@@ -119,7 +119,7 @@ object(stdClass)#%d (1) {
119119
object(stdClass)#%d (1) {
120120
["x"]=>
121121
object(stdClass)#%d (1) {
122-
[0]=>
122+
[%r(0|"0")%r]=>
123123
int(1)
124124
}
125125
}
@@ -145,7 +145,7 @@ object(stdClass)#%d (1) {
145145
object(stdClass)#%d (1) {
146146
["x"]=>
147147
object(stdClass)#%d (1) {
148-
[0]=>
148+
[%r(0|"0")%r]=>
149149
float(3.14)
150150
}
151151
}
@@ -171,7 +171,7 @@ object(stdClass)#%d (1) {
171171
object(stdClass)#%d (1) {
172172
["x"]=>
173173
object(stdClass)#%d (1) {
174-
[0]=>
174+
[%r(0|"0")%r]=>
175175
string(3) "foo"
176176
}
177177
}
@@ -198,7 +198,7 @@ object(stdClass)#%d (1) {
198198
object(stdClass)#%d (1) {
199199
["x"]=>
200200
object(stdClass)#%d (1) {
201-
[0]=>
201+
[%r(0|"0")%r]=>
202202
object(stdClass)#%d (0) {
203203
}
204204
}
@@ -230,7 +230,7 @@ object(stdClass)#%d (1) {
230230
object(stdClass)#%d (1) {
231231
["x"]=>
232232
object(stdClass)#%d (1) {
233-
[0]=>
233+
[%r(0|"0")%r]=>
234234
object(stdClass)#%d (0) {
235235
}
236236
}
@@ -263,7 +263,7 @@ object(stdClass)#%d (1) {
263263
object(stdClass)#%d (1) {
264264
["x"]=>
265265
object(stdClass)#%d (1) {
266-
[0]=>
266+
[%r(0|"0")%r]=>
267267
object(MongoDB\BSON\Binary)#%d (2) {
268268
["data"]=>
269269
string(3) "foo"
@@ -302,7 +302,7 @@ object(stdClass)#%d (1) {
302302
object(stdClass)#%d (1) {
303303
["x"]=>
304304
object(stdClass)#%d (1) {
305-
[0]=>
305+
[%r(0|"0")%r]=>
306306
object(MongoDB\BSON\Decimal128)#%d (1) {
307307
["dec"]=>
308308
string(4) "3.14"
@@ -339,7 +339,7 @@ object(stdClass)#%d (1) {
339339
object(stdClass)#%d (1) {
340340
["x"]=>
341341
object(stdClass)#%d (1) {
342-
[0]=>
342+
[%r(0|"0")%r]=>
343343
object(MongoDB\BSON\Javascript)#%d (2) {
344344
["code"]=>
345345
string(12) "function(){}"
@@ -376,7 +376,7 @@ object(stdClass)#%d (1) {
376376
object(stdClass)#%d (1) {
377377
["x"]=>
378378
object(stdClass)#%d (1) {
379-
[0]=>
379+
[%r(0|"0")%r]=>
380380
object(MongoDB\BSON\MaxKey)#%d (0) {
381381
}
382382
}
@@ -405,7 +405,7 @@ object(stdClass)#%d (1) {
405405
object(stdClass)#%d (1) {
406406
["x"]=>
407407
object(stdClass)#%d (1) {
408-
[0]=>
408+
[%r(0|"0")%r]=>
409409
object(MongoDB\BSON\MinKey)#%d (0) {
410410
}
411411
}
@@ -436,7 +436,7 @@ object(stdClass)#%d (1) {
436436
object(stdClass)#%d (1) {
437437
["x"]=>
438438
object(stdClass)#%d (1) {
439-
[0]=>
439+
[%r(0|"0")%r]=>
440440
object(MongoDB\BSON\ObjectID)#%d (1) {
441441
["oid"]=>
442442
string(24) "586c18d86118fd6c9012dec1"
@@ -473,7 +473,7 @@ object(stdClass)#%d (1) {
473473
object(stdClass)#%d (1) {
474474
["x"]=>
475475
object(stdClass)#%d (1) {
476-
[0]=>
476+
[%r(0|"0")%r]=>
477477
object(MongoDB\BSON\Regex)#%d (2) {
478478
["pattern"]=>
479479
string(3) "foo"
@@ -514,7 +514,7 @@ object(stdClass)#%d (1) {
514514
object(stdClass)#%d (1) {
515515
["x"]=>
516516
object(stdClass)#%d (1) {
517-
[0]=>
517+
[%r(0|"0")%r]=>
518518
object(MongoDB\BSON\Timestamp)#%d (2) {
519519
["increment"]=>
520520
string(4) "1234"
@@ -553,7 +553,7 @@ object(stdClass)#%d (1) {
553553
object(stdClass)#%d (1) {
554554
["x"]=>
555555
object(stdClass)#%d (1) {
556-
[0]=>
556+
[%r(0|"0")%r]=>
557557
object(MongoDB\BSON\UTCDateTime)#%d (1) {
558558
["milliseconds"]=>
559559
string(13) "1483479256924"

tests/functional/query-sort-004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ object(MongoDB\Driver\Query)#%d (%d) {
4848
object(stdClass)#%d (%d) {
4949
["sort"]=>
5050
object(stdClass)#%d (%d) {
51-
[0]=>
51+
[%r(0|"0")%r]=>
5252
int(1)
5353
}
5454
}

0 commit comments

Comments
 (0)