File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ PHP NEWS
38
38
(Ashesh Vashi)
39
39
40
40
- Opcache:
41
+ . Fixed bug #68644 (strlen incorrect : mbstring + func_overload=2 +UTF-8
42
+ + Opcache). (Laruence)
41
43
. Fixed bug #67111 (Memory leak when using "continue 2" inside two foreach
42
44
loops). (Nikita)
43
45
Original file line number Diff line number Diff line change @@ -450,9 +450,11 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
450
450
MAKE_NOP (opline );
451
451
}
452
452
}
453
- } else if (Z_STRLEN (ZEND_OP1_LITERAL (opline )) == sizeof ("strlen" )- 1 &&
454
- !memcmp (Z_STRVAL (ZEND_OP1_LITERAL (opline )),
455
- "strlen" , sizeof ("strlen" )- 1 )) {
453
+ } else if ((!zend_hash_exists (& module_registry , "mbstring" , sizeof ("mbstring" )) ||
454
+ zend_ini_long ("mbstring.func_overload" ,
455
+ sizeof ("mbstring.func_overload" ), 0 ) < 2 /* MB_OVERLOAD_STRING */ ) &&
456
+ Z_STRLEN (ZEND_OP1_LITERAL (opline )) == sizeof ("strlen" ) - 1 &&
457
+ !memcmp (Z_STRVAL (ZEND_OP1_LITERAL (opline )), "strlen" , sizeof ("strlen" ) - 1 )) {
456
458
zval t ;
457
459
458
460
ZVAL_LONG (& t , Z_STRLEN (ZEND_OP1_LITERAL (opline - 1 )));
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #68644 strlen incorrect : mbstring + func_overload=2 + UTF-8 + Opcache
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ mbstring.func_overload=2
7
+ mbstring.internal_encoding=UTF-8
8
+ --SKIPIF--
9
+ <?php if (!extension_loaded ('Zend OPcache ' ) || !extension_loaded ("mbstring " )) die ("skip " ); ?>
10
+ --FILE--
11
+ <?php
12
+ var_dump (strlen ("中国, 北京 " ));
13
+ var_dump (mb_strlen ("中国, 北京 " ));
14
+ ?>
15
+ --EXPECT--
16
+ int(6)
17
+ int(6)
You can’t perform that action at this time.
0 commit comments