Skip to content

Commit 1705d3f

Browse files
Fixing parameters parsing
1 parent bc24121 commit 1705d3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/standard/string.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,16 +1026,16 @@ 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();
10351035
}
10361036

1037-
if (ZEND_NUM_ARGS() == 2) {
1038-
ZEND_PARSE_PARAMETERS_START(1, 2)
1037+
if (ZEND_NUM_ARGS() >= 2) {
1038+
ZEND_PARSE_PARAMETERS_START(2, 2)
10391039
Z_PARAM_STR(arg1_str)
10401040
Z_PARAM_ARRAY_HT(pieces)
10411041
ZEND_PARSE_PARAMETERS_END();

0 commit comments

Comments
 (0)