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 } */
Output for 7.4.0 - 7.4.32, 8.0.1 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.16, 8.3.0 - 8.3.3
{ "strlen": 28, "mb_strlen": 7, "grapheme_strlen": 1 }
Output for 7.4.33
Fatal error: Uncaught Error: Call to undefined function grapheme_strlen() in /in/Cduj5:7 Stack trace: #0 {main} thrown in /in/Cduj5 on line 7
Process exited with code 255.

preferences:
92.98 ms | 402 KiB | 115 Q