Bug #68644 [Opn->Csd]: strlen incorrect : mbstring + func_overload=2 + UTF-8 + Opcache

From: Date: Wed, 24 Dec 2014 10:37:08 +0000
Subject: Bug #68644 [Opn->Csd]: strlen incorrect : mbstring + func_overload=2 + UTF-8 + Opcache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189178@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68644&edit=1 ID: 68644 Updated by: laruence@php.net Reported by: e dot furmanyuk at timeweb dot ru Summary: strlen incorrect : mbstring + func_overload=2 + UTF-8 + Opcache -Status: Open +Status: Closed Type: Bug Package: opcache Operating System: Ubuntu, Centos PHP Version: 5.6.4 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=bba4a8aad52df652c95dfd1d7e2289d479b23b99 Log: Fixed bug #68644 (strlen incorrect : mbstring + func_overload=2 +UTF-8 + Opcache) Previous Comments: ------------------------------------------------------------------------ [2014-12-24 09:31:29] e dot furmanyuk at timeweb dot ru this part: or in .htaccess php_value mbstring.func_overload 2 php_value mbstring.internal_encoding UTF-8 is mistake. we are talking only about the php.ini. ------------------------------------------------------------------------ [2014-12-24 07:59:31] e dot furmanyuk at timeweb dot ru Description: ------------ Greetings. If set in php.ini mbstring.func_overload=2 mbstring.internal_encoding="UTF-8" or in .htaccess php_value mbstring.func_overload 2 php_value mbstring.internal_encoding UTF-8 And set enable extension mbstring and opcache. And after all run the script, the result will be the first implementation of the correct result, but subsequent executions F5 will give an incorrect result. Strlen not overload by mb_strlen. Other function such as substr and strtolower and etc work perfectly. If you disable opcahe problem disappears. Test script: --------------- <?php echo "strlen = ".strlen("\xd0\xa2\xd0\xa2\xd0\xa2\xd0\xa2\xd0\xa2\xd0\xa2")."\n<br>" ; echo "mb_strlen = ".mb_strlen ("\xd0\xa2\xd0\xa2\xd0\xa2\xd0\xa2\xd0\xa2\xd0\xa2")."\n<br>"; ?> Expected result: ---------------- 6 6 Actual result: -------------- 12 6 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68644&edit=1

« previous php.bugs (#189178) next »