3v4l.org

run code in 300+ PHP versions simultaneously
<?php $emoji = "\u{1F469}\u{200D}\u{2764}\u{FE0F}\u{200D}\u{1F48B}\u{200D}\u{1F469}"; echo $emoji , " : " , strlen($emoji) , "\n"; // 27, count byte echo $emoji , " : " , mb_strlen($emoji) , "\n"; // 8, count characters echo $emoji , " : " , grapheme_strlen($emoji) , "\n"; // 1, count grapheme units
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KSSl4
function name:  (null)
number of ops:  21
compiled vars:  !0 = $emoji
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%F0%9F%91%A9%E2%80%8D%E2%9D%A4%EF%B8%8F%E2%80%8D%F0%9F%92%8B%E2%80%8D%F0%9F%91%A9'
    4     1        ECHO                                                     !0
          2        ECHO                                                     '+%3A+'
          3        STRLEN                                           ~2      !0
          4        ECHO                                                     ~2
          5        ECHO                                                     '%0A'
    5     6        ECHO                                                     !0
          7        ECHO                                                     '+%3A+'
          8        INIT_FCALL                                               'mb_strlen'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        ECHO                                                     $3
         12        ECHO                                                     '%0A'
    6    13        ECHO                                                     !0
         14        ECHO                                                     '+%3A+'
         15        INIT_FCALL_BY_NAME                                       'grapheme_strlen'
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0  $4      
         18        ECHO                                                     $4
         19        ECHO                                                     '%0A'
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.56 ms | 1451 KiB | 14 Q