3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 - 7.1.0
Default Encoding = UTF-8 strlen = 10 mb_strlen (UTF-8) = 5 mb_strlen (UTF-8) = 5
Output for 4.3.10 - 4.4.9, 5.0.2 - 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