Don't try to evaluate substr() and strpos() at compile-time if
mbstring function overloading is enabled. I'm reusing the
COMPILE_NO_BUILTIN_STRLEN for the detection of mbstring function
overloading here, even if it's technically only about strlen()...
- ODBC:
. Fixed bug #73725 (Unable to retrieve value of varchar(max) type). (Anatol)
+- Opcache:
+ . Fixed bug #75729 (opcache segfault when installing Bitrix). (Nikita)
+
- Standard:
. Fixed bug #75916 (DNS_CAA record results contain garbage). (Mike,
Philip Sharp)
} else if (zend_string_equals_literal(name, "strpos")) {
if (Z_TYPE_P(args[0]) != IS_STRING
|| Z_TYPE_P(args[1]) != IS_STRING
- || !Z_STRLEN_P(args[1])) {
+ || !Z_STRLEN_P(args[1])
+ || (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
return FAILURE;
}
/* pass */
/* pass */
} else if (zend_string_equals_literal(name, "substr")) {
if (Z_TYPE_P(args[0]) != IS_STRING
- || Z_TYPE_P(args[1]) != IS_LONG) {
+ || Z_TYPE_P(args[1]) != IS_LONG
+ || (CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN)) {
return FAILURE;
}
/* pass */
--- /dev/null
+--TEST--
+Bug #75729: opcache segfault when installing Bitrix
+--SKIPIF--
+<?php if (!extension_loaded('mbstring')) die('skip mbstring not loaded'); ?>
+--INI--
+opcache.enable_cli=1
+mbstring.func_overload=2
+--FILE--
+<?php
+
+var_dump(strpos("foo", "o"));
+
+?>
+--EXPECT--
+Deprecated: The mbstring.func_overload directive is deprecated in Unknown on line 0
+int(1)