Skip to content

Commit a64ff0d

Browse files
Simplifying the parameter check conditions
1 parent 9a9e26e commit a64ff0d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/standard/string.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,15 +1026,13 @@ PHP_FUNCTION(implode)
10261026
zend_string *arg1_str = NULL;
10271027
zend_array *pieces = NULL;
10281028

1029-
if (ZEND_NUM_ARGS() <= 1) {
1029+
if (ZEND_NUM_ARGS() == 1) {
10301030
ZEND_PARSE_PARAMETERS_START(1, 1)
10311031
Z_PARAM_ARRAY_HT(pieces)
10321032
ZEND_PARSE_PARAMETERS_END();
10331033

10341034
arg1_str = ZSTR_EMPTY_ALLOC();
1035-
}
1036-
1037-
if (ZEND_NUM_ARGS() >= 2) {
1035+
} else {
10381036
ZEND_PARSE_PARAMETERS_START(2, 2)
10391037
Z_PARAM_STR(arg1_str)
10401038
Z_PARAM_ARRAY_HT(pieces)

0 commit comments

Comments
 (0)