Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove helper variable key in php_array_find
  • Loading branch information
joshuaruesweg committed May 30, 2024
commit a8dfbbb904dcbe1ce920bbac3d74d9012af6c7e1
6 changes: 2 additions & 4 deletions ext/standard/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -6586,7 +6586,6 @@ static zend_result php_array_find(const HashTable *array, zend_fcall_info fci, z
zend_ulong num_key;
zend_string *str_key;
zval retval;
zval *key;
zval args[2];
zval *operand;
*has_result = false;
Expand All @@ -6599,14 +6598,13 @@ static zend_result php_array_find(const HashTable *array, zend_fcall_info fci, z

fci.retval = &retval;
fci.param_count = 2;
key = &args[1];

ZEND_HASH_FOREACH_KEY_VAL(array, num_key, str_key, operand) {
/* Set up the key */
if (!str_key) {
ZVAL_LONG(key, num_key);
ZVAL_LONG(&args[1], num_key);
} else {
ZVAL_STR_COPY(key, str_key);
ZVAL_STR_COPY(&args[1], str_key);
}

ZVAL_COPY(&args[0], operand);
Expand Down