3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // the Arabic (Hello) string below is: 59 bytes and 32 characters $utf8 = "السلام علیکم ورحمة الله وبرکاته!"; var_export( strlen($utf8) ); // 59 echo PHP_EOL; var_export( mb_strlen($utf8, 'utf8') ); // 32 echo PHP_EOL; var_export( strlen(utf8_decode($utf8))); // 32
based on TJ68c
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.0.5, 5.1.1 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.3.0rc3
59 32 32
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/EcqAq on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
59 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EcqAq on line 7 PHP_EOL32 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EcqAq on line 9 PHP_EOL32