mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/standard: Reuse computed strlen() value in getopt()
This commit is contained in:
@@ -1084,13 +1084,13 @@ PHP_FUNCTION(getopt)
|
||||
}
|
||||
} else {
|
||||
/* other strings */
|
||||
if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, strlen(optname))) != NULL) {
|
||||
if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, optname_len)) != NULL) {
|
||||
if (Z_TYPE_P(args) != IS_ARRAY) {
|
||||
convert_to_array(args);
|
||||
}
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
|
||||
} else {
|
||||
zend_hash_str_add(Z_ARRVAL_P(return_value), optname, strlen(optname), &val);
|
||||
zend_hash_str_add(Z_ARRVAL_P(return_value), optname, optname_len, &val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user