3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(mb_strlen(iconv('utf-8', 'utf-16le', 'A B C')) / 2); # correct var_dump(mb_strlen(iconv('utf-8', 'utf-16le', '🎖')) / 2); # correct var_dump(bin2hex(mb_convert_encoding('A B C', 'UTF-32BE', 'UTF-8'))); # off by 5 chars var_dump(mb_strlen(mb_convert_encoding('🎖', 'UTF-32BE', 'UTF-8')) / 2); # correct
based on 9JkSt
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0beta1
int(5) float(1.5) string(40) "0000004100000020000000420000002000000043" float(1.5)