Skip to content

Commit 645f459

Browse files
committed
revoke the logic
1 parent cd1ffd5 commit 645f459

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

ext/standard/array.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4316,22 +4316,25 @@ PHP_FUNCTION(array_column)
43164316
zval rv;
43174317
zval *keyval = array_column_fetch_prop(data, index_str, index_long, cache_slot_index, &rv);
43184318

4319-
convert_to_string(keyval);
4320-
group_entry = zend_symtable_find(Z_ARRVAL_P(return_value), Z_STR_P(keyval));
4319+
if (keyval) {
4320+
convert_to_string(keyval);
4321+
group_entry = zend_symtable_find(Z_ARRVAL_P(return_value), Z_STR_P(keyval));
43214322

4322-
if (group_entry != NULL) {
4323-
ZVAL_COPY_VALUE(&ft, group_entry);
4324-
} else {
4325-
array_init(&ft);
4326-
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(keyval), &ft);
4327-
}
4323+
if (group_entry != NULL) {
4324+
ZVAL_COPY_VALUE(&ft, group_entry);
4325+
} else {
4326+
array_init(&ft);
4327+
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(keyval), &ft);
4328+
}
43284329

4329-
zend_hash_next_index_insert_new(Z_ARRVAL_P(&ft), colval);
4330+
zend_hash_next_index_insert_new(Z_ARRVAL_P(&ft), colval);
43304331

4331-
if (keyval) {
43324332
zval_ptr_dtor(keyval);
4333+
} else {
4334+
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), colval);
43334335
}
43344336

4337+
43354338
} ZEND_HASH_FOREACH_END();
43364339

43374340
} else {

0 commit comments

Comments
 (0)