@@ -54,6 +54,7 @@ PHP_METHOD(Command, __construct)
54
54
zend_error_handling error_handling ;
55
55
zval * document ;
56
56
bson_t * bson = bson_new ();
57
+ (void )return_value ; (void )return_value_ptr ; (void )return_value_used ;
57
58
58
59
59
60
zend_replace_error_handling (EH_THROW , phongo_exception_from_phongo_domain (PHONGO_ERROR_INVALID_ARGUMENT ), & error_handling TSRMLS_CC );
@@ -106,7 +107,7 @@ static void php_phongo_command_free_object(void *object TSRMLS_DC) /* {{{ */
106
107
zend_object_value php_phongo_command_create_object (zend_class_entry * class_type TSRMLS_DC ) /* {{{ */
107
108
{
108
109
zend_object_value retval ;
109
- php_phongo_command_t * intern ;
110
+ php_phongo_command_t * intern = NULL ;
110
111
111
112
intern = (php_phongo_command_t * )ecalloc (1 , sizeof * intern );
112
113
@@ -122,24 +123,25 @@ zend_object_value php_phongo_command_create_object(zend_class_entry *class_type
122
123
HashTable * php_phongo_command_get_debug_info (zval * object , int * is_temp TSRMLS_DC ) /* {{{ */
123
124
{
124
125
php_phongo_command_t * intern ;
125
- zval * retval = NULL ;
126
+ zval retval = zval_used_for_init ;
126
127
127
128
128
- * is_temp = 0 ;
129
+ * is_temp = 1 ;
129
130
intern = (php_phongo_command_t * )zend_object_store_get_object (object TSRMLS_CC );
130
131
131
- MAKE_STD_ZVAL (retval );
132
- array_init (retval );
132
+ array_init_size (& retval , 1 );
133
133
134
134
if (intern -> bson ) {
135
135
php_phongo_bson_state state = PHONGO_BSON_STATE_INITIALIZER ;
136
136
137
137
MAKE_STD_ZVAL (state .zchild );
138
138
bson_to_zval (bson_get_data (intern -> bson ), intern -> bson -> len , & state );
139
- add_assoc_zval_ex (retval , ZEND_STRS ("command" ), state .zchild );
139
+ add_assoc_zval_ex (& retval , ZEND_STRS ("command" ), state .zchild );
140
+ } else {
141
+ add_assoc_null_ex (& retval , ZEND_STRS ("command" ));
140
142
}
141
143
142
- return Z_ARRVAL_P (retval );
144
+ return Z_ARRVAL (retval );
143
145
144
146
} /* }}} */
145
147
@@ -148,7 +150,7 @@ HashTable *php_phongo_command_get_debug_info(zval *object, int *is_temp TSRMLS_D
148
150
/* {{{ PHP_MINIT_FUNCTION */
149
151
PHP_MINIT_FUNCTION (Command )
150
152
{
151
- (void )type ; /* We don't care if we are loaded via dl() or extension= */
153
+ (void )type ;( void ) module_number ;
152
154
zend_class_entry ce ;
153
155
154
156
INIT_NS_CLASS_ENTRY (ce , "MongoDB\\Driver" , "Command" , php_phongo_command_me );
0 commit comments