Skip to content

Commit

Permalink
Fix array_column() packed hash initialization
Browse files Browse the repository at this point in the history
FILL assumes enough space is alredy allocated -- do that. Note that
the used size is an upper bound, albeit a likely one.
  • Loading branch information
nikic committed Aug 8, 2016
1 parent 33a7ad2 commit cf017ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/standard/array.c
Expand Up @@ -3592,7 +3592,7 @@ PHP_FUNCTION(array_column)
RETURN_FALSE;
}

array_init(return_value);
array_init_size(return_value, zend_hash_num_elements(arr_hash));
if (!zkey) {
zend_hash_real_init(Z_ARRVAL_P(return_value), 1);
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
Expand Down

0 comments on commit cf017ce

Please sign in to comment.