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 } */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cduj5
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%F0%9F%8F%B4%F3%A0%81%A7%F3%A0%81%A2%F3%A0%81%A5%F3%A0%81%AE%F3%A0%81%A7%F3%A0%81%BF'
    5     1        STRLEN                                           ~3      !0
          2        INIT_ARRAY                                       ~4      ~3, 'strlen'
    6     3        INIT_FCALL                                               'mb_strlen'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ADD_ARRAY_ELEMENT                                ~4      $5, 'mb_strlen'
    7     7        INIT_FCALL_BY_NAME                                       'grapheme_strlen'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $6      
         10        ADD_ARRAY_ELEMENT                                ~4      $6, 'grapheme_strlen'
    4    11        ASSIGN                                                   !1, ~4
    9    12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 128
         15        DO_ICALL                                         $8      
         16        ECHO                                                     $8
   16    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.95 ms | 1437 KiB | 15 Q