|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-07-22 08:47 UTC] [email protected]
-Status: Open
+Status: Feedback
[2017-07-22 08:47 UTC] [email protected]
[2017-07-22 10:45 UTC] andxfiles at gmail dot com
[2017-07-22 12:22 UTC] [email protected]
[2017-07-23 03:14 UTC] andxfiles at gmail dot com
[2017-07-23 19:15 UTC] [email protected]
[2017-07-24 06:53 UTC] andxfiles at gmail dot com
[2017-07-24 10:30 UTC] [email protected]
[2017-07-24 22:38 UTC] andxfiles at gmail dot com
[2017-07-26 11:32 UTC] [email protected]
-Assigned To:
+Assigned To: nikic
[2017-07-26 11:32 UTC] [email protected]
[2017-07-26 12:54 UTC] [email protected]
-Status: Feedback
+Status: Closed
[2017-07-26 12:54 UTC] [email protected]
[2018-10-22 13:10 UTC] andxfiles at gmail dot com
[2018-10-22 13:15 UTC] [email protected]
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Mar 17 11:00:01 2026 UTC |
Description: ------------ PHP's 7.1.1 mb_ (multibyte) functions are ~60% slower compared to PHP 5.3. Example of such functions: mb_strlen, mb_stripos, mb_substr. This affects Windows only. On Linux they seem to be way faster compared to PHP 5.3 and there is no such issue. PHP's 7.1.1 installation was done via WebPI (IIS). Test script: --------------- <?php $starttime = microtime(true); for ($i=0; $i<100000; $i++) { $a = mb_strlen("fdsfdssdfoifjosdifjosdifjosdij:ά", "UTF-8"); } $finishtime = microtime(true); echo "mb_strlen: " . number_format($finishtime - $starttime, 4)*1000 ." milliseconds<br/>"; $starttime = microtime(true); for ($i=0; $i<100000; $i++) { $a = mb_stripos("fdsfdssdfoifjosdifjosdifjosdij:ά", "α", 0, "UTF-8"); } $finishtime = microtime(true); echo "mb_stripos: " . number_format($finishtime - $starttime, 4)*1000 ." milliseconds<br/>"; $starttime = microtime(true); for ($i=0; $i<100000; $i++) { $a = mb_substr("fdsfdssdfoifjosdifjosdifjosdij:ά", $i, 1, "UTF-8"); } $finishtime = microtime(true); echo "mb_substr: " . number_format($finishtime - $starttime, 4)*1000 ." milliseconds<br/>"; ?> Expected result: ---------------- php 5.3.28 mb_strlen: 250 milliseconds mb_stripos: 3078.1 milliseconds mb_substr: 281.3 milliseconds php 7.1.1 mb_strlen: 406.3 milliseconds mb_stripos: 4796.9 milliseconds mb_substr: 421.9 milliseconds