3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'äëïöü'; $defaultEncoding = mb_internal_encoding(); $len = strlen($string); $mbLenDefault = mb_strlen($string); $mbLen = mb_strlen($string, 'UTF-8'); echo 'Default Encoding = ' . $defaultEncoding . PHP_EOL . 'strlen = ' . $len . PHP_EOL . 'mb_strlen (' . $defaultEncoding . ') = ' . $mbLenDefault . PHP_EOL . 'mb_strlen (UTF-8) = ' . $mbLen ;
Output for 5.6.0 - 5.6.8, 5.6.10 - 5.6.12, 5.6.14 - 5.6.40, 7.0.0 - 7.0.30, 7.0.32 - 7.0.33, 7.1.0 - 7.1.4, 7.1.6 - 7.1.33, 7.2.0, 7.2.2 - 7.2.3, 7.2.5, 7.2.8 - 7.2.26, 7.3.0 - 7.3.3, 7.3.5 - 7.3.13, 7.4.0 - 7.4.1, 8.1.25 - 8.1.28, 8.2.12 - 8.2.18, 8.3.0 - 8.3.6
Default Encoding = UTF-8 strlen = 10 mb_strlen (UTF-8) = 5 mb_strlen (UTF-8) = 5
Output for 5.6.9, 5.6.13, 7.0.31, 7.1.5, 7.2.1, 7.2.4, 7.2.6 - 7.2.7, 7.3.4

Process exited with code 137.
Output for 4.3.10 - 4.3.11, 4.4.0 - 4.4.9, 5.0.2 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Default Encoding = ISO-8859-1 strlen = 10 mb_strlen (ISO-8859-1) = 10 mb_strlen (UTF-8) = 5
Output for 4.3.3 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WahkO on line 12 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WahkO on line 13 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WahkO on line 14 Default Encoding = ISO-8859-1PHP_EOLstrlen = 10PHP_EOLmb_strlen (ISO-8859-1) = 10PHP_EOLmb_strlen (UTF-8) = 5
Output for 4.3.0 - 4.3.2
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WahkO on line 12 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WahkO on line 13 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WahkO on line 14 Default Encoding = passPHP_EOLstrlen = 10PHP_EOLmb_strlen (pass) = 10PHP_EOLmb_strlen (UTF-8) = 5

preferences:
186.92 ms | 402 KiB | 341 Q