Skip to content

Commit

Permalink
array_init_size() is defined since PHP 5.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Mar 16, 2016
1 parent edd77ed commit 6cbee56
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -2779,11 +2779,7 @@ PHP_METHOD(MongoCollection, distinct)
}

if (zend_hash_find(Z_ARRVAL_P(tmp), "values", strlen("values") + 1, (void **)&values) == SUCCESS) {
#ifdef array_init_size
array_init_size(return_value, zend_hash_num_elements(Z_ARRVAL_PP(values)));
#else
array_init(return_value);
#endif
zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(values), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
} else {
RETVAL_FALSE;
Expand Down

0 comments on commit 6cbee56

Please sign in to comment.