File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1919
2020#include <php.h>
2121#include <Zend/zend_interfaces.h>
22+ #include <Zend/zend_long.h>
2223
2324#include "php_array_api.h"
2425
@@ -91,6 +92,7 @@ static bool php_phongo_bulkwritecommandresult_get_writeerrors(php_phongo_bulkwri
9192 uint32_t len ;
9293 const uint8_t * data ;
9394 zval write_error ;
95+ zend_ulong index ;
9496
9597 if (!BSON_ITER_HOLDS_DOCUMENT (& iter )) {
9698 continue ;
@@ -102,12 +104,14 @@ static bool php_phongo_bulkwritecommandresult_get_writeerrors(php_phongo_bulkwri
102104 continue ;
103105 }
104106
105- if (!phongo_writeerror_init_ex (& write_error , & bson , atoi (bson_iter_key (& iter )))) {
107+ index = (zend_ulong ) ZEND_STRTOUL (bson_iter_key (& iter ), NULL , 10 );
108+
109+ if (!phongo_writeerror_init_ex (& write_error , & bson , (int32_t ) index )) {
106110 zval_ptr_dtor (& write_error );
107111 continue ;
108112 }
109113
110- add_next_index_zval (return_value , & write_error );
114+ add_index_zval (return_value , index , & write_error );
111115 }
112116
113117 return true;
You can’t perform that action at this time.
0 commit comments