3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '🏴󠁧󠁢󠁥󠁮󠁧󠁿'; $res = [ 'strlen' => strlen($str), 'mb_strlen' => mb_strlen($str), 'grapheme_strlen' => grapheme_strlen($str), ]; echo json_encode($res, JSON_PRETTY_PRINT); /* { "strlen": 28, "mb_strlen": 7, "grapheme_strlen": 1 } */

preferences:
35.05 ms | 406 KiB | 5 Q