Skip to content

Commit 9e36a74

Browse files
committed
Constant evaluation of implode()
1 parent e73046e commit 9e36a74

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/opcache/Optimizer/sccp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,12 @@ static inline int ct_eval_func_call(
573573
return FAILURE;
574574
}
575575
}
576+
/* pass */
577+
} else if (zend_string_equals_literal(name, "implode")
578+
&& ((num_args == 1 && Z_TYPE_P(args[0]) == IS_ARRAY)
579+
|| (num_args == 2 && Z_TYPE_P(args[0]) == IS_STRING && Z_TYPE_P(args[1]) == IS_ARRAY)
580+
|| (num_args == 2 && Z_TYPE_P(args[0]) == IS_ARRAY && Z_TYPE_P(args[1]) == IS_STRING))) {
581+
/* pass */
576582
} else {
577583
#if 0
578584
fprintf(stderr, "constant ICALL to %s()\n", ZSTR_VAL(name));

0 commit comments

Comments
 (0)