3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Enter your code here, enjoy! $array = ['a', '๐Ÿ‘', '๐Ÿคก', '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ', '๐Ÿ‘ฉโ€๐Ÿ’ป']; foreach ($array as $string) { echo $string; echo ' - '; echo strlen($string); echo ' - '; echo mb_strlen($string); echo ' - '; $utf16String = mb_convert_encoding($string, 'UTF-16', 'UTF-8'); echo strlen($utf16String) / 2; echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 24
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/C3NOp
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $string, !2 = $utf16String
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    7     1      > FE_RESET_R                                       $4      !0, ->24
          2    > > FE_FETCH_R                                               $4, !1, ->24
    8     3    >   ECHO                                                     !1
    9     4        ECHO                                                     '+-+'
   10     5        STRLEN                                           ~5      !1
          6        ECHO                                                     ~5
   11     7        ECHO                                                     '+-+'
   12     8        INIT_FCALL                                               'mb_strlen'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        ECHO                                                     $6
   13    12        ECHO                                                     '+-+'
   15    13        INIT_FCALL                                               'mb_convert_encoding'
         14        SEND_VAR                                                 !1
         15        SEND_VAL                                                 'UTF-16'
         16        SEND_VAL                                                 'UTF-8'
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !2, $7
   16    19        STRLEN                                           ~9      !2
         20        DIV                                              ~10     ~9, 2
         21        ECHO                                                     ~10
   18    22        ECHO                                                     '%0A'
    7    23      > JMP                                                      ->2
         24    >   FE_FREE                                                  $4
   19    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.71 ms | 1400 KiB | 17 Q