summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyson Andre <tysonandre775@hotmail.com>2020-03-29 17:42:11 -0400
committerTyson Andre <tysonandre775@hotmail.com>2020-03-30 09:54:38 -0400
commit47ddd95836142a5bea28abab26999e72d5f85493 (patch)
treeed875ff2470b90d2bff4a3cac76c8ad2807dface
parentbb6523693cbb3c8cc0cb5fbba0f2f75a1a7523e2 (diff)
downloadphp-git-47ddd95836142a5bea28abab26999e72d5f85493.tar.gz
Do constant evaluation for str_contains in opcache
Both arguments must be strings. str_contains deliberately does not emit a warning for an empty needle. Closes GH-5324
-rw-r--r--ext/opcache/Optimizer/sccp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c
index f9eef41af9..d5c27ca664 100644
--- a/ext/opcache/Optimizer/sccp.c
+++ b/ext/opcache/Optimizer/sccp.c
@@ -954,6 +954,7 @@ static inline int ct_eval_func_call(
}
/* pass */
} else if (zend_string_equals_literal(name, "strpos")
+ || zend_string_equals_literal(name, "str_contains")
|| zend_string_equals_literal(name, "version_compare")) {
if (Z_TYPE_P(args[0]) != IS_STRING
|| Z_TYPE_P(args[1]) != IS_STRING) {